Use current foreground color and draw mode to draw a pixel on the draw window. The cursor position also moved to this pixel.
|
Direct: |
"DPxy" |
|
Arduino: |
void drawPixel(unsigned int x, unsigned int y) //use current color void drawPixel(unsigned int x, unsigned int y, unsigned char c) //use color c |
|
C: |
void Digole_drawPixel(unsigned int x, unsigned int y) |
x, y
The pixel position, could be 1 Byte or 2 Bytes of data, depends on the value.
c
The 256 format color
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.drawPixel(150,300); //draw pixel @(150,300)
serial.writeString("DP\x96\xFF\x2D"); //draw pixel @(150,300)
//for 4.3" IPS modules, use uint16_t type
serial.writeString("DP\00\x96\x01\x2C"); //draw pixel @(150,300)
| Version | Description |
|---|---|