Image splitting into 9 pieces
<p>My Code:</p>

<pre><code>        private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
    {
        ngr.Dispose();
                    List&lt;Image&gt; list = new List&lt;Image&gt;();
        Graphics g = Graphics.FromImage(pictureBox1.Image);
        Brush redBrush = new SolidBrush(Color.Red);
        Pen pen = new Pen(redBrush,3);
        MessageBox.Show(pictureBox1.Image.Width + " " + pictureBox1.Image.Height);
        for (int i = 0; i &lt; pictureBox1.Image.Width; i = (pictureBox1.Image.Width / 3) + i)
        {
            for (int y = 0; y &lt; pictureBox1.Image.Height; y = (pictureBox1.Image.Height / 3) + y)
            {
                Rectangle r = new Rectangle(i, y, pictureBox1.Image.Width / 3, pictureBox1.Image.Height / 3);
                g.DrawRectangle(pen,r );
                if (i &gt; 0 &amp;&amp; y &gt; 0)
                {
                    if (i + r.Width &lt; pictureBox1.Image.Width &amp;&amp; y + r.Height &lt; pictureBox1.Image.Height)
                    {
                        list.Add(cropImage(pictureBox1.Image, r));
                    }
                }
            }
        }
        g.Dispose();
        pictureBox1.Invalidate();
        pictureBox1.Image = list[0];



    }

    private static Image cropImage(Image img, Rectangle cropArea)
    {
        Bitmap bmpImage = new Bitmap(img);
        Bitmap bmpCrop = bmpImage.Clone(cropArea, System.Drawing.Imaging.PixelFormat.DontCare);
        return (Image)(bmpCrop);
    }
</code></pre>

<p>This Code adds only 2 pieces to the list but not the other 7 pieces.</p>

<p>Please Help!!</p>
