![](http://datasheet.mmic.net.cn/260000/PPSMMANUAL_datasheet_15946768/PPSMMANUAL_34.png)
6-10
Using Using Graphics Tools
Programmer’s Manual
REPLACE_STYLE
INVERT_STYLE
6.6
Graphics Tools
The following sections explain each graphics tool with examples.
Top left corner of the panning screen is (0, 0) which is the panning screen origin.
Top left corner of the LCD display screen is an offset from the panning screen
Table 6-9 R = Y
X
Y
R
00
00
00
01
00
00
10
00
00
11
00
00
00
01
01
01
01
01
10
01
01
11
01
01
00
10
10
01
10
10
10
10
10
11
10
10
00
11
11
01
11
11
10
11
11
11
11
11
Table 6-10 R = NOT X
X
R
00
11
01
10
10
01
11
00
Personal Portable System Manager
Programmer’s Manual
6-11
origin. All co-ordinates given to the graphics routines are referred to the panning
screen origin. There is no negative co-ordinate for panning screen.
Some of the graphics routines need to draw dotted line where one of the
argument in calling the routine specifying the length of the dot, e.g. 5 means
drawing 5 dots with specifying grey level and then skipping 5 dots and so on.
Those graphics routines providing dotted line function are DrawHorz(),
DrawVert(), DrawLine() and DrawRec().
DrawDot(), DrawHorz(), DrawVert(), DrawLine(), DrawRec(), DrawCircle(),
DrawEllipse(), DrawArc(), ClearRec() and PutRec() provides function of
which is described above as OR_STYLE, EXOR_STYLE, AND_STYLE, etc.
For all the following examples in this chapter, the panning screen size is 640x480,
LCD display screen size is 320x240 and the LCD display origin is at an offset of
(50, 50) from panning screen origin.
6.7
Get LCD Display Screen Width
U16
GetDisplayX
(void)
GetDisplayX() returns to the caller the physical width, in terms of pixels, of the
LCD display panel being used.
When writing an application, this routine should be used instead of using specific
numbers for the width of the LCD display screen as it will make the code more
flexible to run on different LCD panels.
6.8
Get LCD Display Screen Height
U16
GetDisplayY
(void)
GetDisplayY() returns to the caller the physical height, in terms of pixels, of the
LCD display panel being used.
When writing an application, this routine should be used instead of using specific
numbers for the height of the LCD display as it will make the code more flexible to
run on different LCD panels.
Example 6-2 Get LCD display screen width and height
362 STATUS DrawTextIcon(P_U32 areaId, U16 xSrc, U16 ySrc, U16 width, U16 height,
363
U16 font, P_TEXT message)
364 {
365
366 U16 xDest, yDest;
.
.
.
375 /* Check to see if the coordinates are fall within the LCD screen */
376 if ( (xSrc < 0) || (xDest >= GetDisplayX()) || (ySrc < 0) ||
377
(yDest >= GetDisplayY()) )
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.