Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!ukc!edcastle!rambaut From: rambaut@castle.ed.ac.uk (A E Rambaut) Newsgroups: comp.lang.pascal Subject: Re: putting bitmaps in .exe file Message-ID: <8868@castle.ed.ac.uk> Date: 6 Mar 91 12:26:22 GMT References: <2859@beguine.UUCP> Organization: Edinburgh University Lines: 40 Dan.Bjorklund@samba.acs.unc.edu (Dan Bjorklund) writes: > I'm looking for a way to put a series of bitmaps that my Turbo program uses in the .exe file >so that the program doesn't need to have lots of external files. Is there >an easy way to do this? >Dan.Bjorklund@bbs.acs.unc.edu If you have the bitmaps on disk, you should first go into DOS and use binobj.exe (included with TP) to create an object file. So if you have a bitmap called icon1.bit you would type: BINOBJ icon1.bit icon1.obj icon1 This would produce a file called icon1.obj with a symbol name of icon1 (this is used to reference it in TP). Now back in TP you would add a new procedure to the main body of the program/unit : PROCEDURE Icon1; EXTERNAL; {$L ICON1.OBJ} This produces a dummy procedure and links your icon1.obj file which has the same symbol name. Finally in the procedure that you wish to use the bitmap you do something like the following: Procedure DrawIcon(x,y:integer); var P:pointer; begin P:=@Icon1; putimage(P^,x,y,normalput); {hope this is right - I can't remember the exact format} end; The P:=@Icon1 make the pointer point to the procedure icon1 which is not really a procedure at all but your bitmap masquerading as one. I have a suspicion that I saw this method used in the Tp manuals but I can't be sure. Hope this helps. Andrew.