A SERVICE OF

logo

iVIEW-100 Series user’s Manual, 2006, v2.0 ----- 147
A.3.2 Type 2: Draw & BMP picture (pixel)
Function Description
Pixel Give (X,Y) to draw a dot
VLine Give (X,Y1) & (X,Y2) to draw a vertical line
HLine Give (X1,Y) & (X2,Y) to draw a horizontal line
Line Give 2 points to draw a line
Box Give 2 points to draw a box
BmpShowAt Give a beginning point & a BMP filename to
show the BMP picture
Pixel()
Func.: Give (X,Y) to draw a pixel dot
Syntax:
int Pixel(int X, int Y, int Color);
Header: #include ”mmi100.h”
Description:
X=1~128, Y=1~64
(1,1) is at the top-left of LCD, (128,64) is at the right-bottom.
Color on: color=1, Color off: color=0.
Example:
(lcddraw.c)
#include "mmi100.h"
#include "iview.h"
int main()
{
InitLib();
if(InitLCD()>0) Print("\nLCD wrong");
ClrScrn();
Pixel(5,5,1); /*draw a dot */
VLine(6,6,30,1); /*draw a vertical line */
HLine(6,30,6,1); /*draw a horizotal line */
Line(11,11,118,54,1); /*draw a line */
Box(11,11,118,54,1); /*draw a box */
BmpShowAt(13, 26, "ee.bmp" ,1); /*show a picture */
BmpShowAt(33, 28, "i.bmp" ,1); /*show a picture */
return 0;
}
VLine()
Func.: Draw a vertical line between two points (X,Y1) and (X,Y2).
Syntax:
int VLine(int X, int Y1, int Y2, int Color);
Header: #include ”mmi100.h”
Description:
X=1~128, Y=1~64
(1,1) is at the top-left of LCD, (128,64) is at the right-bottom.
Color on: color=1, Color off: color=0.
Example: Please refer to “Pixel()” for example.