PDA

Click to See Complete Forum and Search --> : Dimensions from DC?


CthulhuDragon
Aug 3rd, 2000, 03:26 PM
Is there a way to get the height and width of a bitmap with a DC?

Sam Finch
Aug 3rd, 2000, 04:54 PM
You Need to Create a new Bitmap using CreateBitmap, Create bitmap Indirect or CreateCompatibleBitmap. Then you need to use Selectobject to put this one into the DC, the return value is the handle of the bitmap inside it.

Then use a DeleteObject Selectobject combo to put the original bitmap in and delete the newly created one.

Now you have the handle of the bitmap, use GetObject with a BITMAP type adn this handle. The BITMAP will then contain info about the bitmap object, including its height and width