Re: Multiple images in a PictureBox Control
- From: "Michael Weber" <no@xxxxxxxxx>
- Date: Fri, 20 Apr 2007 02:25:54 +0200
<prynhart@xxxxxxxxx> skrev i en meddelelse
news:1177026574.989051.119910@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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.pictureBox1_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
.
- Follow-Ups:
- Re: Multiple images in a PictureBox Control
- From: prynhart
- Re: Multiple images in a PictureBox Control
- References:
- Multiple images in a PictureBox Control
- From: prynhart
- Multiple images in a PictureBox Control
- Prev by Date: Re: Making static class ToString() not possible, why?
- Next by Date: After SetParent(), child menu ceases to function
- Previous by thread: Multiple images in a PictureBox Control
- Next by thread: Re: Multiple images in a PictureBox Control
- Index(es):