
92
"C" Programming Guide For Optimus S/R
3.8.5 Image
The
show_image()
function can be used to display images on the LCD. The user needs to
allocate an unsigned char array to store the bitmap data of the image. This array begins with
the top row of pixels. Each row begins with the left-most pixels. Each bit of the bitmap
represents a single pixel of the image. If the bit is set to 1, the pixel is marked, and if it is 0,
the pixel is unmarked. The 1st pixel in each row is represented by the least significant bit of
the 1st byte in each row. If the image is wider than 8 pixels, the 9th pixel in each row is
represented by the least significant bit of the 2nd byte in each row.
get_image
Purpose
To read a bitmap pattern from a rectangular area on the LCD.
Syntax
void get_image (int left, int top, int width, int height, unsigned char *pat);
int left; /* x coordinate of the upper left corner of the rectangle */
int top; /* y coordinate of the upper left corner of the rectangle */
int width; /* width of the rectangle, in dots */
int height; /* height of the rectangle, in dots */
unsigned char *pat; /* pointer to a buffer where bitmap data will be copied to */
Example
get_image (12, 32, 60, 16, buf);
Description
This routine copies the bitmap pattern of a rectangular area on the LCD (whose
top left position and size are specified by left, top, width, and height) to a buffer
(
pat
). The cursor position is not affected after the operation.
Return
None
See Also
show_image
show_image
Purpose
To put a bitmap pattern to a rectangular area on the LCD.
Syntax
void show_image (int left, int top, int width, int height, unsigned char *pat);
int left; /* x coordinate of the upper left corner of the rectangle */
int top; /* y coordinate of the upper left corner of the rectangle */
int width; /* width of the rectangle, in dots */
int height; /* height of the rectangle, in dots */
unsigned char *pat;
/* pointer to a buffer where bitmap data is kept for displaying on the LCD */
Example
show_image (35, 5, 52, 24, Company_logo[]);
Содержание Optimus R
Страница 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Страница 6: ......
Страница 8: ...2 C Programming Guide For Optimus S R...
Страница 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Страница 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Страница 24: ...18 C Programming Guide For Optimus S R...
Страница 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...
Страница 232: ...226 C Programming Guide For Optimus S R 4 11 Implementation defined Limits limits h float h Refer to limit h and float h...
Страница 238: ...232 C Programming Guide For Optimus S R...