Hi!
I would like to know if there is a(n)(easy)way to save images(of different extensions) to a file and to load them back from the file ..(without using rar or other archive file types)
Hi!
I would like to know if there is a(n)(easy)way to save images(of different extensions) to a file and to load them back from the file ..(without using rar or other archive file types)
I think you need some sort of editor to do that, i.e. unDelphix allows you to save all images in dxImageList to one *.dxg file. You can then load, add and remove images from the dxg file. Don't know how to program such an editor though
Wake up from the dream and live your life to the full
Hmm.. Undelphix is only a good choice when you are allready using it in your game/application.
You could try this one:
http://www.delphizip.org/
Or this one:
http://www.dellapasqua.com/delphizlib/
Or check a few of these:
http://www.torry.net/pages.php?s=99
Hope this helps.
Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.
Well so much for easy solutions..but thnx for the help I will try them soon..
Still is there no other way ?
You could use google to find even more zib/compression libraries, or you could write your own package system. If you don't have a lot of demands, this can be simple. If you want to have directories within the package, it becomes a lot harder (I can tell, I've been there. ).
You could write your own package loader/saver by using streams. This may be a good choice as you will learn alot. Check this link If you want to get crackin with Streams:
http://delphi.about.com/od/vclusing/l/aa110803a.htm
You just make a TFileStream object to create a new file (or open an existing one). After that, you can feed your data to the stream, or read data from it. Usually, you start with a little header telling you what and how many data is stored in the file. By using the header data, you can read chunks of data and treat them as seperate files. You could then load the files into your application. (Remember that many objects like TBitmap have a LoadFromStream and SaveToStream method).
Just take a look at streams if you find it interesting. If you want a simple example of how to use them, just ask.
Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.
This is much better thnx !
A few exaples would be nice ..
Windows Vista x64 Ultimate<br />AMD Athlon x64 4000+<br />Codegear Delphi 2009, Delphi 2007, Borland Delphi 7
Hi!
I am having a little trouble (as always ) with loading a picture from a file to a tpicture variable..
Here's what I have problem's with:
Can you please help ?Code:type tpack=record kep:tpicture; nr:integer; hsize:int64; fsize:int64; end; var lpack:array [1..9999] of tpack; ... lpack[1].nr:=1; lpack[1].kep.LoadFromFile('D:\integralas1.jpg'); //It won't let me load the picture.. it gives an error saying "raised exception Class //EAccessViolation with message 'Access violation at adress 00404107 in module .. read //of adress 00000000'" I think it's because I have to "initialize" the tpicture //component somehow but I don't know how .. lpack[1].hsize:=sizeof (lpack[1]); lpack[1].fsize:=sizeof (lpack[1]); ...
Initialize:
lpack[1].kep := TPicture.Create;
Then later when you want to clean up and free memory;
lpack[1].kep.Free;
thnx a lot !
Btw will this write the picture to the file ?(in case of large pictures as well.. )
Code:strm.Writebuffer(lpack[1],sizeof (tpack));
Bookmarks