Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!comp.vuw.ac.nz!cavebbs!frank From: frank@cavebbs.gen.nz (Frank van der Hulst) Newsgroups: comp.os.msdos.programmer Subject: Re: Turbo C getimage() image format? Message-ID: <1991Jun18.015412.20940@cavebbs.gen.nz> Date: 18 Jun 91 01:54:12 GMT References: <1991Jun17.152139.1@vax1.tcd.ie> Organization: The Cave MegaBBS, Public Access Usenet, Wellington, NZ Lines: 36 In article <1991Jun17.152139.1@vax1.tcd.ie> dbearly@vax1.tcd.ie writes: >Could someone please e-mail me the format of the image saved when I >use the getimage(...) and putimage(...) functions of Turbo C's BGI >library? Its detailed in the manual -- 2 words giving width & height, followed by data (1 bit per pixel for B/W, dunno about others). I think that there may also be an extra word after the width and height. > >Also how would I go about storing images within files, say within an >EXE file? Here's what I did -- display the image on-screen and use getimage to capture it, then write it to a file, still in binary. Next, write a wee program which reads a binary file and writes it out in hex, including 0x before each byte, and a comma after each... maybe also throw in some new-lines. At the beginning of the text file, add (either with an editor, or by putting it in the filter program) the following: char XXXX[] = { and at the end add }; Now compile the file using Turbo C... that'll give you a .OBJ, which you can link into your executable. (BTW, insert the correct name where I put XXXX above). In the run-time version of the program, use putimage(XXXX) to display the image. Frank. -- Take a walk on the wild side, and I don't mean the Milford Track. Kayaking: The art of appearing to want to go where your boat is taking you.