Thread: Storing a bitmap directly in cpp

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571

    Storing a bitmap directly in cpp

    I have heard you can do this by use of arrays? I don't want to have to send someone my bitmaps with my program, just the executable. Another person told me I needed a program to put a bitmap into my source for me. Is it really all that complicated? Thanks in advance.

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    You can include a bitmap as a resource, which is then "compiled" into the .exe. Have a look at resources in your compilers documentation.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Davros
    Guest
    I imagine you could place a bitmap in the CPP file as an array, but it would be awkard (you may have to write a quick program to get at the pixel values).

    Better to place the image in the resouce as suggested, unless there's a reason not to do this (and I can't think of one).

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571

    Talking

    Thanks for the help guys! Adrian I will try that, putting it in as a resource file. Thanks again!

  5. #5
    Registered User
    Join Date
    Apr 2002
    Posts
    77
    after you out into the resorce
    how to you retrive it out ????
    any coding ?

  6. #6
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Originally posted by monkeymon
    after you out into the resorce
    how to you retrive it out ????
    any coding ?
    Look up LoadBitmap() on MSDN

  7. #7
    ‡ †hë Ö†hÈr sîÐè ‡ Nor's Avatar
    Join Date
    Nov 2001
    Posts
    299
    Try to help all less knowledgeable than yourself, within
    the limits provided by time, complexity and tolerance.
    - Nor

  8. #8
    Registered User
    Join Date
    Apr 2002
    Posts
    77
    i dun get the meaning that msdn is trying to say
    any example or this LoadBitmap ???

  9. #9
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793

  10. #10
    Registered User
    Join Date
    Apr 2002
    Posts
    77
    Originally posted by Fordy
    Try here
    Sorry i dont get wat r they toking abt
    when i import the bitmap into the vc++ already then how
    becoz im using MFC so quite alot of thing im not beri sure
    i only know how to retrive bitmap from the computer......

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with Bitmap Display
    By The Brain in forum Windows Programming
    Replies: 7
    Last Post: 03-23-2009, 05:33 AM
  2. Loading a bitmap (Without using glaux)
    By Shamino in forum Game Programming
    Replies: 7
    Last Post: 03-16-2006, 09:43 AM
  3. OpenGL -- Bitmaps
    By HQSneaker in forum Game Programming
    Replies: 14
    Last Post: 09-06-2004, 04:04 PM
  4. Loading a Bitmap resource for OpenGL Texture[x]
    By the dead tree in forum Game Programming
    Replies: 4
    Last Post: 08-26-2004, 01:12 PM
  5. bitmap not going onto screen
    By stallion in forum Windows Programming
    Replies: 4
    Last Post: 02-22-2003, 10:07 AM