BitmapGet Function (ROM Call 0x185)

graph.h

void BitmapGet (const SCR_RECT *rect, void *BitMap);

Gets a bitmap from the port graphical functions are writing to.

BitmapGet stores a series of bytes (the size of which is defined by BitmapSize) defining a bitmap for a rectangular area (whose boundaries are given using the SCR_RECT structure rect) into a buffer pointed to by BitMap. The data is fetched in the port graphical functions are writing to (see PortSet). The first two words at the address BitMap will contain the height and the width (in pixels) of the rectangular area respectively, then the actual data follows. BitMap is usually a pointer to a BITMAP structure.

Here is a simple example (called "Bitmap Test"), which uses BitmapGet and BitmapPut to get the contents of the TI-89 screen and to restore it later:

// Retrieve and store a bitmap

#define USE_TI89              // Compile for TI-89
#define USE_TI92PLUS          // Compile for TI-92 Plus
#define USE_V200              // Compile for V200

#define OPTIMIZE_ROM_CALLS    // Use ROM Call Optimization

#define MIN_AMS 100           // Compile for AMS 1.00 or higher

#include <tigcclib.h>         // Include All Header Files

// Main Function
void _main(void)
{
  SCR_RECT full_screen = {{0, 0, LCD_WIDTH - 1, LCD_HEIGHT - 1}};
  char buffer [BITMAP_HDR_SIZE + LCD_WIDTH*LCD_HEIGHT/8]; // or 2004 for a TI-89 and 3844 for a TI-92+/V200 if you like it more
  BitmapGet (&full_screen, buffer);          // store screen in buffer
  clrscr ();
  printf ("Press any key to\nrestore screen...");
  ngetchx ();
  BitmapPut (0, 0, buffer, &full_screen, A_REPLACE);
  ngetchx ();
}
Note that this is just an example: for saving/restoring the whole screen, functions LCD_save and LCD_restore are much more efficient! And, 'buffer' will probably be allocated using malloc in a more realistic example...


Uses: BitmapInit
Used by: ScrRectScroll, ScrRectShift, MenuKey, WinBitmapGet, WinOpen, ROM Call 0x421


See also: BitmapPut, BitmapSize, CalcBitmapSize