Thread: Does anyone have a bitmap handling header file

  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, 10:39 PM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. header file compile error
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 02-23-2002, 06:28 AM