Archived

This topic is now archived and is closed to further replies.

Bezzant

file io and custom files

Recommended Posts

just a few questions, nothing direct. file loading. could someone please explain the concept behind loading any type of file, whether it be a sound, graphic, or whatever file. i mean like the process, like getting the file header (lets assume i would know about the file format - thats what wotsit.org is for ). and then, about making a custom 'paint' program. lets say i write a paint program (not that i can anyhow) that writes a custom file that first defines the image height and width and then the rgb values for each pixel... then write a function that will read that data and draw the each pixel on the screen with the correct rgb colors, thus loading my custom image. to me that sounds kinda right. have i got the right idea, or miles off? been kinda interested lately in fileI/O and custom files thanks for your time EDIT: damn typos Edited by - Bezzant on October 22, 2001 3:43:43 PM

Share this post


Link to post
Share on other sites

1.) Open the file.
2.) Read in the file header, which usually contains information about
file size, format, etc.
i.) Usually this requires you to know the header size (or just create
a header structure and read that in)
3.) Read in the rest of the file.

You''re generally on the right path.

Share this post


Link to post
Share on other sites