<pr******@gmail.comskrev i en meddelelse
news:11**********************@n59g2000hsh.googlegr oups.com...
I have a PictureBox Control which is 96*96 pixels. I want to display
nine 32*32 pixel bitmaps in this control arranged in a 3X3 square. How
can I do this ? All the examples I've seen load only one image in the
PictureBox.
The code:
board.ClientSize = new Size(96, 96);
board.Image = (Image)image1;
displays image1 in the top left hand corner. How can I display images
2 - 9 ?
Thanks,
Patrick
board..Paint += new
System.Windows.Forms.PaintEventHandler(this.pictur eBox1_Paint);
....
private void pictureBox1_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
// Create Point for upper-left corner of image1.
Point P1 = new Point(0, 0);
e.Graphics.DrawImage(image1, P1);
Point P2 = new Point(0, 32);
e.Graphics.DrawImage(image2, P2);
//.... and so forth
}
Best regards
Michael Weber