Thread: How to append bmp files to an EXE?

  1. #1
    JoeDDDDYYY
    Guest

    How to append bmp files to an EXE?

    Hello there, I just created a program that will load an image onto screen using a bitmap file. Now I want to put this BMP File into the EXE without using a resource file.

    This way it will all come out in a single EXE program. I was told to use Append() to do this. Does anyone have the time to explain how to do this with append? How can I append a file to the EXE and how can I make the program read it from itself?

    Thanks in advance.

    J

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    my first question would be why don't you want to use a resource file? you can use "custom" resources that are just binary which can store anything you want. That's how you would do something like a self extracting installer. You would zip it all and put it in as a custom resource. LoadResource() LockResource() are the calls I believe you use to get at them.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    JOEDDDDYYY
    Guest

    re

    I was told Append was better. I dont want to use resources becouse I am making a program that will work on all platforms, including Linux.

    Plus, I dont want whatever is appended to the EXE to be extracter. I dont want that bitmap file to be stolen and used without permission and I dont want it to be edited either. Its sort of like a game engine, that has a single exe file and nothing else.

    J

  4. #4
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    Well, I'm not even familiar with Append().

    I think you have just a couple choices.

    -use a second data file
    -ifdef for the system you're compiling for and use system specific resources
    -hard code the binary. There are hex editors that will output C style arrays you can use. This will work on all systems and might be your best bet.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  5. #5
    C > C++ duders ggs's Avatar
    Join Date
    Aug 2001
    Posts
    435
    if you know how to link in external objects, try using nasm and it's %incbin directive.
    .sect signature

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I can't make bmp image files show up in an SDL window
    By Lucas89 in forum Game Programming
    Replies: 5
    Last Post: 05-25-2009, 01:04 PM
  2. Problem reading BMP
    By Mortissus in forum C Programming
    Replies: 4
    Last Post: 02-02-2006, 06:32 AM
  3. Using c++ standards
    By subdene in forum C++ Programming
    Replies: 4
    Last Post: 06-06-2002, 09:15 AM
  4. EXE files...
    By Brian in forum C Programming
    Replies: 7
    Last Post: 02-19-2002, 12:42 AM
  5. Create exe files
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 09-16-2001, 08:02 PM