Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to obtain the HDC of a HBITMAP?

Status
Not open for further replies.

ultra2

Programmer
Jun 26, 2005
46
HU
how to obtain the HDC of a HBITMAP?

stretch blt need src and dest HDCs, but I have an image control which has a picture property and I know the handle for the Bitmap (HBitmap)

plz help
 
An hBitmap does not have an hDC

You would need to select the bitmap into an device context first

However, since all you seem to be trying to do (reading other posts) is resize an image held in an imagelist, why not just use VB's PaintPicture method?
 
yes, I did and It works, but I have an other problem, the pictures became ugly as I shrink them with PaintPicture..
 
Absolutely.

But it gets more difficult the prettier you want it to be ...

Next level is indeed to use StretchBlit with the approriate StretchMode set. Check out my example in thread222-539638

Next level after that is probably to use GDI+, but we'll leave that for now ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top