Hi
I used the below code for split an image into 16 pieces.But its not working..Please help me...
Download Picture and results here...
https://drive.google.com/file/d/0B_1aiVUSMOJocEIyb0dnWEZYak0/view?usp=sharing[
^]
https://drive.google.com/file/d/0B_1aiVUSMOJobEVXLTFiYlRaYU0/view?usp=sharing[
^]
Code is..
private void button1_Click(object sender, EventArgs e)
{
Image img = Image.FromFile(@"C:\Users\Manuprasad M\Downloads\kristen-stewart_416x416.jpg");
Bitmap[,] bmps = new Bitmap[4, 4];
for (int i = 0; i < 4; i++)
for (int j = 0; j < 4; j++)
{
bmps[i, j] = new Bitmap(104, 104);
Graphics g = Graphics.FromImage(bmps[i, j]);
g.DrawImage(img, new Rectangle(0, 0, 104, 104), new Rectangle(j * 104, i * 104, 104, 104), GraphicsUnit.Pixel);
g.Dispose();
}
pictureBox1.Image = bmps[0, 0];
pictureBox2.Image = bmps[0, 1];
pictureBox3.Image = bmps[0, 2];
pictureBox4.Image = bmps[0, 3];
pictureBox5.Image = bmps[1, 0];
pictureBox6.Image = bmps[1, 1];
pictureBox7.Image = bmps[1, 2];
pictureBox8.Image = bmps[1, 3];
pictureBox9.Image = bmps[2, 0];
pictureBox10.Image = bmps[2, 1];
pictureBox11.Image = bmps[2, 2];
pictureBox12.Image = bmps[2, 3];
pictureBox13.Image = bmps[3, 0];
pictureBox14.Image = bmps[3, 1];
pictureBox15.Image = bmps[3, 2];
pictureBox16.Image = bmps[3, 3];
}