Draw a circle/disc on the draw window

Description

  Use current foreground color, draw mode to draw a circle or filled circle(disc) on the draw window

Usage:

Direct:

"CCxyrf" //Draw a circle: center point:(x,y), ratio=r, if f==1, fill the circle

Arduino:

void drawCircle(unsigned int x, unsigned int y, unsigned int r, unsigned char f)

void drawDisc(unsigned int x, unsigned int y,  unsigned int r)

C:

void Digole_drawCircle(unsigned int x, unsigned int yunsigned int r, unsigned char f)

void Digole_drawDisc(unsigned int x, unsigned int y, unsigned int r)

Parameters:

(x, y)

The pixel position of the center point of circle (disc).

r

The pixels ratio of circle/disc

f

The flag of fill, f=1, fill the circle.

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

Return:

none

Example (Arduino):

mydisp.drawCircle(150,120,100,1); //draw a filled circle, the center point @(150,120), ratio=100px

Example(direct)

serial.writeString("CC\x96\x78\x64\x01"); //draw a filled circle, the center point @(150,120), ratio=100px

//for 4.3" IPS modules, use uint16_t type
serial.writeString
("DP\00\x96\x00\x78\x00\x64\x01"); //draw a filled circle, the center point @(150,120), ratio=100px

Changelog

Version Description
   

See Also

Set draw mode

Set foreground color

Set Draw Window