Joe
Joe

Reputation: 101

How can I export multiple images and strings to a single file?

I'm creating an application that needs to export a few images and a few strings. It currently exports to a folder, but I want to be able to export all of these into a single file. How can I store all this information when the size and quantity of images varies? I've read a few articles, but they don't say how to store the strings. I do not want to use a database.

Upvotes: 2

Views: 293

Answers (2)

JoshDM
JoshDM

Reputation: 5072

How about a compressed folder archive? Save everything as you currently do into a folder, but zip or tar or otherwise compress the folder into a single archive file.

Upvotes: 0

DeanOC
DeanOC

Reputation: 7282

If you create a class with properties to hold the images and strings, you can use binary serialization to persist them to a single file. Then you can use deserialization to re-load everything into a new class instance when you want to use them again.

This article will give you an idea (it is in C#)

http://techisolutions.blogspot.co.nz/2008/03/serialization-of-image-c.html

Upvotes: 1

Related Questions