To: djgpp AT delorie DOT com, admcs AT megsinet DOT net Date: Tue, 8 Apr 1997 08:26:30 -0700 Subject: Re: Can't get this to work (Allegro) Message-ID: <19970408.082634.11982.0.bshadwick@juno.com> From: bshadwick AT juno DOT com (Ben N Shadwick) >Could someone please tell me how I could get this to open notecard.pcx and >display it (centered) on the mode 13h screen? > >Thanks in advance, >Paul Schmidt >ADM Computer Services >admcs AT megsinet DOT net Well, I made a program to test out some Allegro functions, and the first thing it does is centers a large bitmap on the screen. Here's some of the code: (note: h and v are defined to be 320 and 240 [the size of the video mode I default to] respectively, unless the user passes different values for the screen mode, in which case they are given those values, provided the program didn't already exit due to an invalid mode. Also, the code should be able to adapt itself to any size bitmap and screen) scott = load_bmp("scott.bmp",q); printf("SCOTT.BMP loaded, width: %i height: %i\n", scott->w, scott->h); printf("Press a key to begin...\n"); readkey(); set_palette(q); fade_out(64); /* set palette to bitmap and immediately blank out to avoid garbage flicker */ x=((h)-(scott->w))/2; y=((v)-(scott->h))/2; blit(scott, screen, 0, 0, x, y, scott->w, scott->h); fade_in(q,1); clear_keybuf(); readkey(); Ben Shadwick, Sysop, Mars Base BBS (360)882-0773, Vancouver, WA, USA email: bshadwick AT juno DOT com I am now telling the computer EXACTLY what it can do with a lifetime supply of chocolate!!!