Width and Height from HBITMAP ?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Width and Height from HBITMAP ?

  1. #1
    Join Date
    Apr 2011
    Posts
    14

    Width and Height from HBITMAP ?

    Hi guys,

    If I get a bitmap from the clipboard with:

    hBitmap=(HBITMAP)GetClipboardData(CF_BITMAP);

    ...how do I get the width and height ? Can I get at the BITMAPINFO ?

    Thanks.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,466

    Re: Width and Height from HBITMAP ?

    Use GetObject API and pass in BITMAP structure
    Victor Nijegorodov

  3. #3
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    3,966

    Re: Width and Height from HBITMAP ?

    Code:
    BITMAP bm;
    ::GetObject(hBitmap, sizeof(bm), &bm);
    width and height should be filled in the bm structure (along with some other fields).

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center