Results 1 to 2 of 2

Thread: Dimensions from DC?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Posts
    94

    Question

    Is there a way to get the height and width of a bitmap with a DC?

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width