CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2011
    Posts
    22

    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
    Hanover Germany
    Posts
    20,396

    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
    4,626

    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
  •  





Click Here to Expand Forum to Full Width

Featured