file io and custom files

Started by
0 comments, last by Bezzant 22 years, 6 months ago
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
Advertisement
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.

This topic is closed to new replies.

Advertisement