I would like to download information about movies at runtime and at the same time download images that I can display, but I don not want to save many image files on client computer, so I would like to just save them as resources and make one big file if possible?
-
Why do you want to avoid saving many files, but don't mind using the same disk space for a single big file? Is there a reason to complicate your application with this? Or is this something else, like, you want to keep the images in memory, but never write them to disk?R. Martinho Fernandes– R. Martinho Fernandes2011-01-03 16:24:20 +00:00Commented Jan 3, 2011 at 16:24
-
Well if I have a folder with 1000 image files then that seems like a mess, plus the client can deletes/edits the images. Is it a stupid idea?Mech0z– Mech0z2011-01-03 16:27:05 +00:00Commented Jan 3, 2011 at 16:27
-
1If you don't like a single folder, why not a folder with subfolders? And what prevents the user from deleting one file (your "resource" file) over one of the others? And why would a user edit one of the images (and why would you care?).Wonko the Sane– Wonko the Sane2011-01-03 16:36:42 +00:00Commented Jan 3, 2011 at 16:36
2 Answers
What is wrong with saving the files? IF you don't want that, you will have to create your own file format, and then save files into that stream.
You can also keep all images in memory, but this way, the memory usage of your app will increase a lot if you use a lot of images (that might or might not be visible).
2 Comments
You can consume anything in theory and translate it to a byte[] at runtime; images included.
The data has to go somewhere though, either on the clients local disk or within memory. Saving the file as resources...ie...being coupled within the DLL by default is consuming disk space.
A better approach may to simply retrieve your images and store them within a temp directory at runtime. You could provide a settings area where the user can purge this directory as needed or make use of it for caching purposes which could scale back the need to retrieve images each and every time.