Thread: HBITMAP to BITMAP

  1. #1
    Registered User DutchStud's Avatar
    Join Date
    Oct 2001
    Posts
    43

    HBITMAP to BITMAP

    Does anyone know of an easy way of converting HBITMAP to BITMAP so I can have the bitmap info. when I use GetObject() i can't access the info of the pixels. any help? It's probably really easy, but i'm not figuring it out.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Have you tried LockResource()?

    This should give a pointer to the data

  3. #3
    Registered User VBprogrammer's Avatar
    Join Date
    Mar 2002
    Posts
    175
    I used to do this in VB but i cant figure out how to convert it to C++
    VC++ 6

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    There is

    Bitmap::FromHBITMAP(hbm, hpal) in MSVC requiring GDI+ in non NT systems.

    Or GetDIBits() may help.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Loading bitmap file into a HBITMAP
    By wind_addict in forum Windows Programming
    Replies: 9
    Last Post: 11-17-2007, 10:42 AM
  2. drawing on bitmaps
    By eth0 in forum Windows Programming
    Replies: 2
    Last Post: 03-24-2006, 05:56 PM
  3. Bitmap Displaying Problem
    By MadCow257 in forum Game Programming
    Replies: 0
    Last Post: 01-25-2005, 05:21 PM
  4. OpenGL -- Bitmaps
    By HQSneaker in forum Game Programming
    Replies: 14
    Last Post: 09-06-2004, 04:04 PM
  5. bitmap not going onto screen
    By stallion in forum Windows Programming
    Replies: 4
    Last Post: 02-22-2003, 10:07 AM