Images in files vs VC Resources

Started by
5 comments, last by St_Shadow 23 years, 9 months ago
What are the differences in loading an image from a file vs putting them in the workspace''s resource file. Wich way is better and why?
Advertisement
I''m not completely sure, so don''t consider my statements as 100% correct advices.

1. Anyone can pull out a resource from an exe file, knowing the resource ID. Your own resource file will prevent this, if implemented properly.
2. If your data file is changed, you will have to recompile your project in order for these changes to take effect. This can be VERY annoying, and inefficient. This is the main reason.
3. It''s late, I''ve been coding for 11 hours straight at work, so I can''t think anymore
WHOOOOHOOOO, I''m A martyr!!!! Yeah, baby!!!!
Not to mention it also bloats the size of your executable.I think a good rule of thumb is to leave pictures in seperate files, and icons in your resource file (unless you have a lot of icons, then leave them out also).

----------
meh
----------meh
Thanks people, you confirmed what I had thought
Resources inside your EXE will definitely bloat the file size, but Windows will not load those pages into memory until they''re used. The best way to keep resources, if you have a lot of them, is to create a resource DLL. Then you can recompile the resource DLL whenever you want without recompiling your program. Also, it keeps them tidy in a single file rather than raw files in a directory. A resource DLL is Window''s equivelant of a doom ''WAD'' file.. heh..

// CHRIS
// CHRIS [win32mfc]
Actually, the best way to keep lots of images would be in a wad type file.Both pak and wad files are good examples, because many editors for them already exist; you can manage them without writing a packer program.All you would need is an unpacking routine in your program which you could be as simple or complex as you want.
Resource files and libraries are an okay solution for windows, but the second you step out, you''ll have to use a different way to store your files, and have multiple file bases for each os.If you use wad or pak (both easy formats to use), you wouldn''t need to rewrite code (assuming you use standard functions for reading) or repack files.

Just something to think about



----------
meh
----------meh

This topic is closed to new replies.

Advertisement