1

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?

3
  • 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? Commented 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? Commented Jan 3, 2011 at 16:27
  • 1
    If 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?). Commented Jan 3, 2011 at 16:36

2 Answers 2

3

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).

Sign up to request clarification or add additional context in comments.

2 Comments

For now I think I will just use files then, do avoid filling my memory but I think I will save it in some container later.
It's best to create a custom temp folder with a naming convention. This way, you can re-use the images on that computer. If you use a good-thought naming convention, the temp folder is your container (and you can make the images hidden if you want to).
2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.