This function draws a filled rectangle on the display.

Syntax

void FillScreen(
  unsigned short start_x, 
  unsigned short start_y,
  unsigned short end_x, 
  unsigned short end_y, 
  unsigned long color
);

Parameters

start_x
[in] Specifies the start of the upper left corner of the rectangle. (X coordinate)
start_y
[in] Specifies the start of the upper left corner of the rectangle.(Y coordinate)
end_x
[in] Specifies the end of the lower right corner of the rectangle.(X coordinate)
end_y
[in] Specifies the end of the lower right corner of the rectangle. (Y coordinate)
color
[in] The fill color of the rectangle.
ValueDescription
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)
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("[FillScreen]\n");
    printf("Please any key\r");
    ResetKey();
    while(!kbhit())
        Idle();
    for (lvIndex = 0; lvIndex < 5; lvIndex++)
    {
        printf("Please any key\r");
        FillScreen(DISP_WIDTH/4, DISP_HEIGHT/4,
		DISP_WIDTH/4*3, DISP_HEIGHT/4*3, color[lvIndex]);
        ResetKey();
        while(!kbhit())
            Idle();
    }
}

Last updated: 2020/10/02