PDA

Click to See Complete Forum and Search --> : How do i compile images


Thanathos
May 1st, 2002, 12:33 PM
I want to compile images in some sort of resource file... like an msagent character file.

but i dont want to add it to my project... instead i want to have it as a separate "character file" for loading it at runtime

Any ideas?

Gaming_World
May 1st, 2002, 02:43 PM
You could always just create your own "format" for storing the data in one file. Such as having the beginning of the file store where the split points are, and IDs for the files. Then, when your program is run, split the file apart for temporary processing. Or else, split out the file needed for the current process.

In this way, you could also write a custom compressing procudure, to also reduce the file size slightly, ecentilly creating your own zip file. Even without the compressing, the files would take up slightly less space as you wouldn't lose the slight amounts from the 4KB fat size (that is on NTFS and FAT 32; its 8KB on FAT; all files must be a mutiple of this size).

Thanathos
May 1st, 2002, 10:01 PM
I was thinking i would have to do something of that


But then that towards me to some other questions like

1) Do I Just Open the Files for binary INPUT and drop them in a second file? (recording the split sections) or does the operating system have some kind of spec table of its own, that i dont have access to this way, to store information of the file like name and description (like in the property tabs)

2)Is there some api or object you know that can do this for me?

3)Compression, Compression... how to do it? even some basic one


THANKS IN ADVANCE ... I know this are a lot of questions for a single thread... any help is greatly apretiated any thing i can help (jajaja i can't be sure is enough) i will.

Sastraxi
May 1st, 2002, 10:06 PM
There is a free zipping library that you can use, called gZip. It's free... all I can remember is it's website looks like a PNG website or something like that :D

Sastraxi
May 1st, 2002, 10:07 PM
There's the bugger!

http://www.gzip.org/zlib/

Thanathos
May 1st, 2002, 10:13 PM
Thanks Sastraxi

I am having a look on it now.. This is just what i need at the moment... but i surely would like to know at least about the general idea of compresion and about how window stores files... any references would be apretiated.


Thanxs Satraxi.. great work, you do here

Gaming_World
May 1st, 2002, 11:43 PM
I can't help you with the basics of compression except for the following two statements: 1) It makes the data take up less room (aka Compresses), and 2) it takes code.

And don't bother to state that the information about compression I just posted is completely useless (not to mention obvisis)...

Hack
May 2nd, 2002, 08:38 AM
Just a curiousity question: why not use a resource file and compile it with your program?

Gaming_World
May 2nd, 2002, 09:28 AM
I would guess that it has to do with updating.

Thanathos
May 2nd, 2002, 11:01 PM
i want the users to make "characters" (animated by the images i want to compile) and save them and even share them...

most of all im interested in my own "character" Format

Sastraxi
May 2nd, 2002, 11:33 PM
Yes, with your own you can save stats such as walking speed and such in a header portion of your bitmap, which would be a cool idea. Also, if you just leave it as an area you put text in, you can add stuff in the future and won't have to add too much more code.

Sastraxi
May 2nd, 2002, 11:37 PM
Compression is basically the "art" of taking something and putting it into smaller size, whether it be lossy or lossless.

An example of lossy - JPEG, DivX, MPEG.
An example of lossless - GIF, PNG, ZIP, RAR.

With data, you can't use lossy compression techniques - the data must match the input bit by bit or the information will not be as expected. It works for auditory and visual means however, because it does not contain script or code, and the eyes and ears can be fooled by subtle effects.

While I won't get into too many details here, lossless compression is simplifying repetition/redundancy into one passage, so it only appears once in the file. Of course, since this directly moves and modifies the code you won't be able to run it without decompressing it first.

I'm sure howstuffworks.com will have an article (or already has a section!) on compression.

Thanathos
May 3rd, 2002, 01:36 PM
Thanxs again

Ill be reading howstuffworks.com article soon...

right now im am on finals...

but ill use this information to make my program and ill make it accesible thru here...... I can always use constructive criticism