Archived

This topic is now archived and is closed to further replies.

If only...

This topic is 5499 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The topic is a little of the subject, but hey. I''m loading a file into e HBITMAP and then putting the integer into a file using fwrite(). No errors so far. Programs closes, Ok, but the file is only 4bytes. Logically, it should be the 17.5kb that the *.bmp is. So, arises my two questions. A) Is a HBITMAP only a pointer (or something similar) to a file. B) Would saving a LPDIRECTDRAWSURFACE7 with fwrite() work. Any help would be nice... The past was unknown, the future was predicted.

Share this post


Link to post
Share on other sites
Your bitmap file will not be physically included into your exe file. So if you delete the bitmap from your hard drive your program will no longer be able to find it.

"Discipline is never an end itself, only a means to an end." - Robert Fripp

Share this post


Link to post
Share on other sites
quote:
Original post by Tooko
The topic is a little of the subject, but hey.
I''m loading a file into e HBITMAP and then putting the integer into a file using fwrite().
No errors so far. Programs closes, Ok, but the file is only 4bytes. Logically, it should be the 17.5kb that the *.bmp is.

So, arises my two questions.
A) Is a HBITMAP only a pointer (or something similar) to a file.
B) Would saving a LPDIRECTDRAWSURFACE7 with fwrite() work.

Any help would be nice...

The past was unknown, the future was predicted.


The integer is only 4 bytes, and that is what you are writing to the file. The integer is a pointer to the bitmap structure. Also note that the bitmap structure *in memory* is not the same one stored on disk, and so it is unlikely to be the same size as the BMP. If you wish to save the BMP data to a file you should either use standard API functions (from the same group used to load the file), or implement a custom file format in which you save the key portions of the bitmap structure (width, height, color depth [, palette] and pixel data) to a file in what origanization you see fit.

Share this post


Link to post
Share on other sites
What I wish, is to load several bitmaps say, into an array and place them all in one file (much like a utx or wad file)

Any ideas?

The past was unknown, the future was predicted.

Share this post


Link to post
Share on other sites