Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A better way to store bitmaps than in the resource file?

Status
Not open for further replies.

rzward

Programmer
Nov 6, 2002
38
0
0
US
Hello,

I have a MSVC 6.0 SP5 MFC application that has dialog boxes and toolbars that show many small pictures stored in bitmap files. I have references to these bitmap files in the application's resource file.

The problem is there are 310 of these bitmap files and there are going to be more. This currently tacks on around 2.8 MB to the executable file.

Are there other ways of storing bitmap files that are just as fast to load but do not cause the executable to grow?

For example, maybe I can put all of the bitmaps in a DLL and then load them by calling an API I provide from the DLL.

Any suggestions would be greatly appreciated.

Richard
 
>> but do not cause the executable to grow?

I don't think you need to worry about your executable getting too big.

If you're concerned about taking up too much hard disk space, then there's no way to avoid that. You could put the bitmaps in a data file, in which case you'd have a large data file. Or you put the bitmaps in your executable, in which case you have a large executable.

If you're concerned about memory, don't worry because resources aren't loaded until they're needed.

>> load them by calling an API I provide from the DLL.

You don't need to provide your own library function for this. Just use good old LoadBitmap, passing the HINSTANCE that you obtained from loading the DLL with LoadLibrary.



[sub]I REALLY hope that helps.[/sub]
Will
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top