Syntax
void DrawEllipse(
int cx,
int cy,
int xradius,
int yradius,
int color
);
Parameters
- cx
-
[in] ]Specifies the x-coordinate position of the center of the ellipse.
- cy
-
[in] Specifies the y-coordinate position of the center of the ellipse.
- xradius
-
[in] Specifies the semi-major axis of the horizontal axis (x) of the ellipse.
- yradius
-
[in] Specifies the semi-major axis of the vertical axis (Y) of the ellipse.
- color
-
[in] Specifies the color of the ellipse line.
Value Description 0xRRGGBB Optional specification (RR: red, GG: green, BB: blue) RGB_WHITE White (0xFFFFFF) RGB_RED Red (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)
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)
Value | Description |
---|---|
DISP_WIDTH | 128 pixel |
DISP_HEIGHT | 160 pixel |
Requirements
Header file:
lib.hLibrary 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("[DrawEllipse]\n");
printf("Please any key\r");
ResetKey();
while(!kbhit())
Idle();
for (lvIndex = 0; lvIndex < 5; lvIndex++)
{
printf("Please any key\r");
DrawEllipse(DISP_WIDTH/2, DISP_HEIGHT/2, DISP_WIDTH/4, DISP_HEIGHT/4, color[lvIndex]);
ResetKey();
while(!kbhit())
Idle();
}
}
<Last updated: 2020/10/02