Use current foreground color, draw mode and line pattern to draw a rectangle on the draw window, also can set the rectangle be filled or not.
Direct: |
"DRxyx1y1" //Draw a rectangle from (x,y)top-left to (x1,y1)bottom-right "FRxyx1y1" //Draw a filled rectangle from (x,y)top-left to (x1,y1)bottom-right |
Arduino: |
void drawFrame(unsigned int x, unsigned int y, unsigned int width, unsigned int heigth) void drawBox(unsigned int x, unsigned int y, unsigned int width, unsigned int heigth) |
C: |
void Digole_drawFrame(unsigned int x, unsigned int y, unsigned int width, unsigned int heigth) void Digole_drawBox(unsigned int x, unsigned int y, unsigned int width, unsigned int heigth) |
(x, y),(x1,y1)
The pixel position of top-left or bottom-right of rectangle.
width
Rectangle width of pixels
height
Rectangle height of pixels
NOTE: if the value of x or y greater than "254", then use 2 bytes format: the first byte is fix of 255, then the second byte is the value minus 255. eg.300=255+45, so, "\xFF\x2D" is the result.
This schedule is in order to compatible small displays, which the width and height is less than 255 pixels
Warning:The 4.3" IPS modules are always use 2 bytes regular integrate format.
none
Example (Arduino):
mydisp.drawFrame(50,30,200,100); //draw a rectangle from top-left @(50,30), width 200px, heigth:100px
serial.writeString("DR\x32\x1E\xFA\x82"); //draw a rectangle from top-left @(50,30), width 200px, heigth:100px
//for 4.3" IPS modules, use uint16_t type
serial.writeString("DP\00\x32\x00\x1E\x00\xFA\x00\x82"); //draw a rectangle from top-left @(50,30), width 200px, heigth:100px
Version | Description |
---|---|