Jump to content
  • Advertisement


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


AUX_RGBImageRec to file

This topic is 6194 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all can someone tell me how to write a bmp which is loaded into an AUX_RGBImageRec in a file? my program only write 4 byte to file where are the pixel information in memory? thx for help --=[[TheMatrixXXX]]=--

Share this post

Link to post
Share on other sites
the struct for the aux_rgbimagerec is in glaux.h

basically it is
unsigned char *data

so all you have to do is save *data to a file. It makes it easier if you also save sizex and sizey so you know how big the image is.

the default size of the actual structure is sizex*sizey*3 as it is a 3 element array, red green blue.

fwrite(out,sizex*sizey*3,1,data) or something like that (forgot the order of fwrite) will do it for you, then jsut use malloc and fread to get them back in again.

Beer - the love catalyst
good ol'' homepage

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!