I have a PictureBox
control. I want to put an image in this PictureBox
.
This I did:
pictureBox1.Image = Image.FromFile(@"D:\test.jpg");
I don't want the image to fill the entire PictureBox
.
Next, I want to draw graphics on the PictureBox
which I do using the following code:
Graphics g = pictureBox1.CreateGraphics();
g.DrawArc(....);
g.DrawLine(....);
It should be something as shown in the following picture:
In the above picture, the image should be only in the bounds of the blue rectangle, around which I want to draw the graphics. How to draw an image?