🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #7108

Re: Turbo C getimage() image format?

#7108
From: Frank van der Hulst
Date: Tue, 18 Jun 1991 01:54
36 lines
1840 bytes
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.
Technical Details
Message-ID: <1991Jun18.015412.20940@cavebbs.gen.nz>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!comp.vuw.ac.nz!cavebbs!frank
References: <1991Jun17.152139.1@vax1.tcd.ie>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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