I want to split a single picturebox into three partitions so that i can save my image in in three locations with different sizes.. is there anyone know how to do.. plz help me doing this
You can use an array with a size of 3. Then it's much easier to do this using a couple of loops like this:
var imgarray = new Image[3]; var img = Image.FromFile("media\\a.png"); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { var index = i * 3 + j; imgarray[index] = new Bitmap(104, 104); var graphics = Graphics.FromImage(imgarray[index]); graphics.DrawImage(img, new Rectangle(0, 0, 104, 104), new Rectangle(i * 104, j * 104, 104, 104), GraphicsUnit.Pixel); graphics.Dispose(); } }
Then you can fill your boxes like this:
pictureBox1.Image = imgarray[0];
pictureBox2.Image = imgarray[1];
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
You can use an array with a size of 3. Then it's much easier to do this using a couple of loops like this:
Then you can fill your boxes like this:
pictureBox1.Image = imgarray[0];
pictureBox2.Image = imgarray[1];