Paul,
What you need to do is create a new instance of the Bitmap class which
starts out as the size that you want to crop down to.
Then, pass the instance of the new image to the static FromImage method
on the Graphics class. This will return a Graphics instance you can use to
draw the cropped image on.
Once you have that, you can call the following overload of DrawImage:
Overloads Public Sub DrawImage( _
ByVal image As Image, _
ByVal destPoints() As Point, _
ByVal srcRect As Rectangle, _
ByVal srcUnit As GraphicsUnit _
)
This will allow you to pass the original Image instance, as well as the
area on it you want to paint, as well as the destination area.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Paul E Collins" <fi******************@CL4.org> wrote in message
news:bs**********@titan.btinternet.com...
I need to load a bitmap image, crop it, and save it.
By cropping, I don't mean resizing - I mean reducing it to a fixed size
area.
Image img = Bitmap.FromFile("in.bmp");
// what goes here?
img.Save("out.bmp");
img.Dispose();
Code rather than a URL would be ideal, as VB.NET examples do nothing for
me.
Thanks.
P.