Display color image on the draw window

Description

Display color image on the draw window. support 256 color (1 byte:RRRGGGBB), 64K color(2 bytes:RRRRRGGG,GGGBBBBB) and 262K color(3 bytes:00RRRRRR,00GGGGGG,00BBBBBB) format. Transparent setting apply to this command 

Usage:

Direct:

 "EDIMfxywh" follow with color image data

Arduino:

void drawColorImg(uint8_t format, uint16_t x, uint16_t y, uint16_t w, uint16_t h, const uint8_t *bitmap)

C:

void Digole_drawColorImg(uint8_t format, uint16_t x, uint16_t y, uint16_t w, uint16_t h, const uint8_t *bitmap)

Parameters:

f,format

The image's color depth, '1':256 color, '2':64K color, '3':262K color depth

x, y

The pixel position of top-left of the area.

w, h

The pixel size of the width and height of the image.

bitmap

The pointer to the color image data

Return:

none

NOTE: if the value of x,y,w or h 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.

Example (Arduino):

const uint8_t bitmap[]={......} //bit map data
mydisp.drawColorImg('2',20,30,80,85,&bitmap);//draw 64K color image, the top-left @(20,30), width=80px,height=85px

Example(direct)

 

const uint8_t bitmap[]={......} //bit map data
serial.writeString("DIMA2\x14\x1E\x50\x55");//draw 64K color image, the top-left @(20,30), width=80px,height=85px
for(int i=0;i<80*85*2;i++)
serial.write(bitmap[i]);

Changelog

Version Description
   

See Also

Set draw mode

Set draw window 

Set transparent