www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/09/12:08:08

Reply-To: "James Arthur" <james AT arfa DOT clara DOT net>
From: "Arthur" <arfa AT clara DOT net>
To: "DJGPP Mailing List" <djgpp AT delorie DOT com>,
"Qin" <JJSIERRA AT santandersupernet DOT com>
Subject: RE: - How put a image whit only one file ?-
Date: Wed, 9 Sep 1998 16:58:20 +0100
Message-ID: <000201bddc0a$aa532000$894b08c3@arthur>
MIME-Version: 1.0
In-Reply-To: <6srhq4$lc5$1@talia.mad.ibernet.es>
Importance: Normal

>     How can i put a image on the screen (320x200) without a bmp
> or dat file,
> only with a exe file?
> I have Allegro but i don't know how do it.
> Anybody have a sprite editor that give a file in c format for put
> the image
> on the screen?

If you can output the binary data of the BITMAP structure to a file, you may
be able to cut and paste that data into a header file - perhaps in the form
of an array of unsigned chars. Simply point to that data with a cast. For
example if it's in an array called image_data[],

BITMAP *picture;
picture = (BITMAP *)image_data;

Since you didn't load the image or use create_bitmap, there is no need to
use destroy_bitmap. Oh, and this won't save any palette data.

There is an easier way. There's a program which will append a dat file to
the end of an exe file. It's called exedat and is in the tools folder. Also
see example program ex34.exe.

HTH

James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019