www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/10/11:12:18

Message-Id: <199812101610.QAA17641@remus.clara.net>
From: "Arthur" <arfa AT clara DOT net>
To: <djgpp AT delorie DOT com>
Subject: RE: Display a picture!
Date: Thu, 10 Dec 1998 16:09:28 -0000
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
In-Reply-To: <199812100724.CAA25049@delorie.com>
Reply-To: djgpp AT delorie DOT com

> #include <allegro.h>
>
/*
> main(){
*/
int main(void) {

> 	allegro_init();
> 	install_timer();
> 	install_keyboard();

BITMAP *bmp;
PALETTE pal;

>
> 	set_gfx_mode(GFX_AUTODETECT,320,200,0,0);

/*
> 	bmp=load_bitmap("foo.bmp");
This won't work.
*/

bmp = load_bitmap("foo.bmp",pal);

set_palette(pal);

>
> 	blit(bmp,screen,0,0,0,0,320,200);
> 	while(!key[KEY_SPACE]);

destroy_bitmap(bmp);

> }
>
> ----------
> > From: Claes Ericson <coboltski AT telia DOT com>
> > To: djgpp AT delorie DOT com
> > Subject: Display a picture!
> > Date: Wednesday, December 09, 1998 7:36 PM
> >
> > Does anyone have a small source code for displaying a picture (in any
> > format) in DJGPP without using Allegro?

Umm. Without using Allegro? Read in the file directly to a block of memory.
The file format is available everywhere - try your favourite game
programming website. One way to show it is to plot each pixel to the screen,
or if you have a LFB copy the memory block in one go.

James Arthur - jaa AT arfa DOT clara DOT net
http://www.arfa.clara.net/james/
ICQ#15054819


- Raw text -


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