This function draws a cicle on the display.

Syntax

void DrawCircle(
  int cx,
  int cy,
  int r,
  int color
);

Parameters

cx
[in] Specifies the x-coordinate position of the center of the circle.
cy
[in] Specifies the y-coordinate position of the center of the circle.
r
[in] Specifies the radius of the circle
color
[in] Specifies the color of the circle line.
ValueDescription
0xRRGGBB Optional specification (RR: red, GG: green, BB: blue)
RGB_WHITE White (0xFFFFFF)
RGB_RED Ret (0xFF0000)
RGB_GREEN Green (0x00FF00)
RGB_BLUE Blue (0x0000FF)
RGB_MAGENTA Magenta (0xFF00FF)
RGB_CYAN Cyan (0x00FFFF)
RGB_YELLOW Yellow (0xFFFF00)
RGB_BLACK Black (0x000000)

Return value

None

Remarks

This function uses the dot coordinates of the screen to draw the line.
The values that can be set are as follows.
X (Left and Right): 0 〜 (DISP_WIDTH - 1)
Y (Up and Down): 0 〜 (DISP_HEIGHT - 1)
When the display of the status bar is set, the Y coordinate values that can be set are as follows.
Y (Up and Down): 0 〜 (DISP_HEIGHT - 17)
ValueDescription
DISP_WIDTH 128 pixel
DISP_HEIGHT 160 pixel

Requirements

Header file:
lib.h
Library file:
libSTARTUPOPH5000.a

Sample

#include <stdio.h>
#include "lib.h"

void main(void)
{
    long color[5] = {RGB_WHITE,RGB_RED,RGB_GREEN,RGB_BLUE,RGB_BLACK};
    int lvIndex;
    printf("[DrawCircle]\n");
    printf("Please any key\r");
    ResetKey();
    while(!kbhit())
        Idle();
    for (lvIndex = 0; lvIndex < 5; lvIndex++)
    {
        printf("Please any key\r");
        DrawCircle(DISP_WIDTH/2, DISP_HEIGHT/2, DISP_WIDTH/4, color[lvIndex]);
        ResetKey();
        while(!kbhit())
            Idle();
    }
}

Last updated: 2020/10/02