robodale
New member
I am having trouble trying to copy a portion of a previously created Bitmap image I have created. Basically what I am trying to do is pass in a Bitmap image I have created into a method which then saves a 100 x 100 portion of the original image into a new Bitmap object. I then save both the original and new image so I can see what the result is. My code that doesnt work follows:
public void ProcessGraphics(Bitmap bitmapORIG)
{
System.Drawing.Image image;
Bitmap bitmapNEW;
image = (Image) bitmapORIG;
bitmapNEW = new Bitmap(image, 100, 100);
image.Save(@"C:\temp\Image_Original.gif", System.Drawing.Imaging.ImageFormat.Gif);
bitmapNEW.Save(@"C:\temp\Image_New.gif", System.Drawing.Imaging.ImageFormat.Gif);
}
The only thing that my coding above does is resize (rescale?) the original image into a smaller image. This is not what I want - I merely want a 100 x 100 part of the original image, in its original scale.
Anybody know how I should attack this?
many thanks.
public void ProcessGraphics(Bitmap bitmapORIG)
{
System.Drawing.Image image;
Bitmap bitmapNEW;
image = (Image) bitmapORIG;
bitmapNEW = new Bitmap(image, 100, 100);
image.Save(@"C:\temp\Image_Original.gif", System.Drawing.Imaging.ImageFormat.Gif);
bitmapNEW.Save(@"C:\temp\Image_New.gif", System.Drawing.Imaging.ImageFormat.Gif);
}
The only thing that my coding above does is resize (rescale?) the original image into a smaller image. This is not what I want - I merely want a 100 x 100 part of the original image, in its original scale.
Anybody know how I should attack this?
many thanks.
Last edited by a moderator: