save_bitmap   (3alleg) manpage
save_bitmap
3alleg
version 4.1.15 (CVS)
Allegro
Allegro manual
  • NAME
      save_bitmap
  • SYNOPSIS
      #include <allegro.h>


      int save_bitmap(const char *filename, BITMAP *bmp, const RGB *pal);
  • DESCRIPTION
      Writes a bitmap into a file, using the specified palette, which should be an array of 256 RGB structures. Returns non-zero on error. The output format is determined from the filename extension: at present this function supports BMP, PCX and TGA formats.
      Two things to watch out for: on some video cards it may be faster to copy the screen to a memory bitmap and save the latter, and if you use this to dump the screen into a file you may end up with an image much larger than you were expecting, because Allegro often creates virtual screens larger than the visible screen. You can get around this by using a sub-bitmap to specify which part of the screen to save, eg:
      
         BITMAP *bmp;
         PALETTE pal;
         
         get_palette(pal);
         bmp = create_sub_bitmap(screen, 0, 0, SCREEN_W, SCREEN_H);
         save_bitmap("dump.pcx", bmp, pal);
         destroy_bitmap(bmp);
      

  • SEE ALSO
      save_bmp (3alleg), save_pcx (3alleg), save_tga (3alleg), load_bitmap (3alleg), register_bitmap_file_type (3alleg)
Current Users: 55 © 1999-2006 Linux.com.hk PenguinSoft
All trademarks and copyrights on this page are owned by their respective companies. Linux is a trademark of Linus Torvalds.