![](http://datasheet.mmic.net.cn/260000/PPSMMANUAL_datasheet_15946768/PPSMMANUAL_37.png)
6-20
Using Using Graphics Tools
Programmer’s Manual
Example 6-12 Draw a thick horizontal line
STATUS ret;
/* set dot width to 4 */
ret = SetDotWidth(4, 0);
if (ret !=PPSM_OK)
return ret;
/* draw a black horizontal line from (60, 60) with width 2 */
ret = DrawHorz(BLACK, 60, 60, 2, 0, REPLACE_STYLE);
if (ret != PPSM_OK)
return ret;
In the above example, a thick horizontal line will be drawn as follow:
6.19
Draw a Vertical Line
STATUS
DrawVert
(U16 greyLevel U16 xSrc U16 ySrc U16 height U16
dotLine U16 style)
This routine will draw a vertical line from (xSrc, ySrc) to (xSrc, ySrc + height - 1).
Figure 6-9 Screen output for Example 6-11
LCD
Panning Screen
(50, 50)
(0, 0)
(50, 60)
(580, 60)
(369, 60)
Figure 6-10 Screen output for Example 6-12
(61, 60)
(60, 60)
Personal Portable System Manager
Programmer’s Manual
6-17
6.16
Fill the whole Panning Screen
STATUS
ClearScreen
)
Example 6-6 Fill the whole screen with WHITE
STATUS ret;
/* fill the whole panning screen with white */
ret = ClearScreen(WHITE);
6.17
Draw a Dot
STATUS
DrawDot
(U16
)
This routine will draw a dot at the specified position (
).
If dot width is 1, a pixel will be drawn. If dot width is 2, a square dot of length 2 will
be drawn with top left pixel position as the dot co-ordinate, (
the dot width is greater than 2, a circular disc with radius to be truncated integer
value of (dot width - 1)/2 will be drawn. The center of the disc will be the dot co-
ordinate, (xPos yPos).
). When
Example 6-7 Draw a black dot
STATUS ret;
/* draw a dot at (52, 52) */
ret = DrawDot(BLACK, 52, 52, REPLACE_STYLE);
The calling of DrawDot(BLACK, 52, 52) will draw a black pixel at (52, 52) in
panning screen. As the LCD display screen origin is at (50, 50), the point drawn
on screen is at (2, 2) in display co-ordinate. Hence, the expected outcome will
have a dot which is very close to the display origin.
Example 6-8 Draw a dot with dot width 2
STATUS ret;
Figure 6-4 Screen output for
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.