bwells Posted April 8, 2003 Posted April 8, 2003 Can someone suggest a way to resample a bitmap? I want to create a bitmap where I get every other pixel's data from an existing bitmap. For instance, my original bitmap is 512x1024, and I want to create a new bitmap that is 256 x 512. Quote
*Experts* Bucky Posted April 8, 2003 *Experts* Posted April 8, 2003 If you just want to resize it, then you can do so with the DrawImage method of any Graphics class. Create a new Bitmap class of the new size you want. Then create a Graphics class that is set by using Graphics.FromImage, passing the new Bitmap as a parameter to FromImage. Then use the DrawImage metho of the Graphics object to draw the original Bitmap onto the new one one, with a Rectangle of the size of the new image. The DrawImage method automatically resizes the image. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
bwells Posted April 9, 2003 Author Posted April 9, 2003 Can you be more specific about how the image is resized? If I want to display an image at 1/2 the original size, does this mean the Graphics DrawImage operation uses every other pixel? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.