 |
BitmapGet |
Function (ROM Call 0x185) |
Gets a bitmap from the screen.
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 SCR_RECT structure rect)
into a buffer pointed to by BitMap. The first two words at address
BitMap will contain the height and the width (in pixels) of the rectangular
area respectively, then 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, 159, 99}};
char buffer [BITMAP_HDR_SIZE + 160*100/8]; // or 2004 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 realictic example...
Uses: BitmapInit
Used by: ScrRectScroll, ScrRectShift, MenuKey, WinBitmapGet, WinOpen, ROM Call 0x421
See also: BitmapPut, BitmapSize, CalcBitmapSize