TIP: Click on subject to list as thread! ANSI
echo: locuser
to: All
from: david begley
date: 1994-12-02 20:05:36
subject: Borland `getimage` Format?

Does anyone know the *exact* format of images saved using Borland's
"getimage" command (Pascal and C), as used in the BGI package?

Using WATCOM C16, I want to read in some images that were saved with
"getimage" then written directly to disk .. I have the images
appearing on the screen, but there is (consistently) a single bar of pixels
from the left side of the image that always appears on the right .. this
doesn't affect the entire rest of the image.

Ideas?

The code I'm using is:

 -----[ snip, snip ]-----

#include 
#include 
#include 
#include 
#include 
#include 

int main( int argc, char *argv[] )
{
   struct videoconfig  VC;
   struct stat         fi;
   FILE                *fh;
   void                *mp;

   fh = fopen( argv[1], "rb" );
   fstat( fileno(fh), &fi );
   mp = malloc(fi.st_size);
   fread( mp, fi.st_size, 1, fh );
   fclose(fh);

   _getvideoconfig(&VC);
   if( (VC.adapter == _VGA) || (VC.adapter == _SVGA) )
   {
      _setvideomode(_VRES16COLOR);
      _putimage( 2, 2, mp, _GPSET );
      getch();
      _setvideomode(_DEFAULTMODE);
   }
   else
      fprintf( stderr, "fatal: only vga and svga supported\n" );

   free(mp);
   return(0);
}

 -----[ snip, snip ]-----

Thanks..


    - dave
    d.begley{at}ieee.org

---
* Origin: [ epicentre of the universe -- sydney australia ] (3:711/934.4)
SEEN-BY: 711/934
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.