extracting part of a graphic in a PictureBox

R

ray well

i need to extract a rectangular area from a graphic image displayed in a
PictureBox, to another PictureBox.

how can i do that? i would appreciate a piece of code if possible.

thanks,

ray
 
G

Guest

using (Graphics graphics = image1.CreateGraphics())
{
graphics.DrawImage(image2.Image, new Rectangle(0, 0, 100,
100), new Rectangle(150, 150, 50, 50), GraphicsUnit.Pixel);
}

image1 and image2 are picture boxes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top