Does anyone have a bitmap handling header file

This is a discussion on Does anyone have a bitmap handling header file within the Windows Programming forums, part of the Platform Specific Boards category; I'm not all that good at windows programming, but I am hoping for the ability to load a random bitmap ...

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    75

    Question Does anyone have a bitmap handling header file

    I'm not all that good at windows programming, but I am hoping for the ability to load a random bitmap to display for a program that i am working on. Does anyone know where there might be a header file that might include functions that will return, say, a HBITMAP from a PSTR parameter. It would be pretty useful.

    Thx

  2. #2
    Unregistered
    Guest
    LoadImage loads bitmaps, icons and cursors from resources or files. This fn supercedes LoadBitmap, LoadIcon and LoadCursor but these fns all still work ok and are arguably simpler to use by the novice as there are fewer parameters.

    HBITMAP hBmp=LoadBitmap(0,"MyBitmapFile.bmp");

    Remember that bitmaps, like most GDI (graphics device interface) objects are system resource consumers, so use the DeleteObject fn on the handle when you are finished with it.

    ie. DeleteObject(hBmp);

    syntax for LoadImage might be:

    HBITMAP hBmp=(HBITMAP)LoadImage(0,"MyBitmapFile.bmp",IMAGE _BITMAP,0,0,LR_CREATEDIBSECTION|LR_LOADFROMFILE);

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    75

    Thx

    Yeah, thx, that does help me out some. Thats the only bitmap handling function I really needed.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 11:39 PM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 05:14 AM
  3. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 02:19 PM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 10:54 AM
  5. header file compile error
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 02-23-2002, 06:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21