Bitmap loading question
Well, right now I'm making a windows application where I need to load a bitmap to the window, I need to know when I create my bmp loader, to hold all the pixel data from the file(which should be stored in the first 52 bytes right?) and I send my program to others, will they need the bmp to see the picture in the program? If so, how do I make it so they dont?
I know I dont need to make a bitmap loader, but I have me reasons why I want to >.>, mainly because I want to be able to make one if im not programming in win32 api.
If you rely on an external file, like a BMP file, the end user will need that file.
If you want to not rely on such a file, you would need to embed the file in your executable (maybe as a string).
It's easier to just rely on your BMP.
Ok, well can you please give me a description of how to do so? because if I knew it would make things more convenient. Or where to go so I can learn how to embed my bmp in my executable.
If this is your file:
then you could put this into your program:
Of course, if your file contains weird chars you might have a string that ends up looking like this:
const char *filecontents = "Hello, World!\n";
It would be better to rely on an external file.
const char *stuff = "\044\744Hj_=\222";
BTW, embedding something into your executable will increase the executable's size.
It wont matter if it increases my executables file or not (currently its only 6kb and almost done)
Well, will it matter if you rely on an external file?
Perhaps a BITMAP resource is appropriate here. http://msdn.microsoft.com/library/de...p_resource.asp
>> hold all the pixel data from the file(which should be stored in the first 52 bytes right?)
Well, the BITMAPINFO structure is 44 bytes. What were you referring too?
I was referring to the header, where all the bitmap info is stored, which I think you just answered =P. thanks.