0
votes

Is there any way to modify the size of a HBITMAP (bitmap) obtained using CreateDIBSection(). say, for example, the bitmap size is width and height.

but in fact, bmpBits are filled with data which is for an image size of width/2, height/2.

I am thinking that I can regenerate a HBITMAP object with size of width/2 and height/2, then draw it to the display. But I wonder if there are other better ways to do it, since I am pretty new to this.

Thanks a lot.

1

1 Answers

1
votes

No, there's no way to resize a bitmap once it's created. You have to create a new bitmap and copy into it.

However you don't have to draw the whole bitmap in your GDI calls. For example StretchDIBits has the nSrcWidth and nSrcHeight parameters.