Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • *Experts*
Posted

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.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Posted
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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...