What is a basic graphic control?

To be compatible with the basic graphic instructions for drawing lines, circles, rectangles, and images in old basic products, basic graphic controls are introduced to meet the demand. The basic graphic controls are controlled by sending instructions through the serial port. Each basic graphic control has a storage area of 1024 bytes, and the serial port screen will save the drawing instruction part of the received instructions into the storage area.
This section mainly introduces the instruction format
Scope of application: F type, M series, H series
17.1 Basic display
Different graphics correspond to different drawing instructions, and one instruction can draw one or multiple graphics. When drawing again, the previous image will be cleared. The instruction format is shown in the following table:
| Offset | Data item | Length | Description |
|---|---|---|---|
| 00H | EE | 1 | Frame header |
| 01H-02H | B1 10 | 2 | Instruction flag of basic graphic control |
| 03H-04H | SCREEN_ID | 2 | ID of the screen |
| 05H-06H | CONTROL_ID | 2 | ID of the basic graphic control |
| * | Drawing instruction 1 | * | Varies depending on the graphic |
| … | … | … | … |
| * | Drawing instruction N | * | Depending on the graphic |
| Last 4 bytes | FF FC FF FF | 4 | Frame end |
17.2 Additional display
When using the additional mode, the old graphic will not be cleared. The new graphic will be added on top of the existing one, which is different from the basic display. It has an additional 0xCC byte. The instruction format is shown in the following table:
| Offset | Data item | Length | Description |
|---|---|---|---|
| 00H | EE | 1 | Frame head |
| 01H-02H | B1 10 | 2 | Command flags for basic graphic controls |
| 03H-04H | SCREEN_ID | 2 | ID of the screen |
| 05H-06H | CONTROL_ID | 2 | ID of the basic graphic control |
| 07H | CC | 1 | Append mode |
| * | Drawing command 1 | * | Varies depending on the graphic |
| … | … | … | … |
| * | Drawing instruction N | * | Varies depending on the drawing |
| Last 4 bytes | FF FC FF FF | 4 | Frame end |
17.3 Clear display
The format of the clear drawing instruction is shown in the following table:
| Offset | Data item | Length | Description |
|---|---|---|---|
| 0H | EE | 1 | Frame header |
| 01H-02H | B1 10 | 2 | Command flags for basic graphic controls |
| 03H-04H | SCREEN_ID | 2 | ID of the screen |
| 05H-06H | CONTROL_ID | 2 | ID of the basic graphic control |
| Last 4 bytes | FF FC FF FF | 4 | Frame trailer |
17.4 Draw a straight line
As per the instruction: EE B1 10 00 00 00 01 01 01 FF 00 32 00 32 00 C8 00 C8 FF FC FF FF, it indicates that the basic graphic control with ID 1 on page 0 uses the color 0x01FF to draw a straight line between screen coordinates (50,50) and (200,200).
| Offset | Data Item | Length | Description |
|---|---|---|---|
| 07H | 01 | 1 | Straight Line Instruction |
| 08H-09H | COLOUR | 2 | Color |
| 10H-11H | X0 | 2 | X-coordinate of the first point |
| 12H-13H | Y0 | 2 | Y coordinate of the first point |
| 14H-15H | X1 | 2 | X coordinate of the second point |
| 16H-17H | Y1 | 2 | Y coordinate of the second point |
17.5 Multi-point line
As per the instruction: EE B1 10 00 00 00 01 02 01 FF 00 32 00 32 00 C8 00 C8 00 64 00 64 FF FC FF FF, it indicates that in the basic graphic control with ID 1 on page 0, the color 0x01FF is used to draw two straight lines between screen coordinates (50,50), (200,200), and (100,100).
| Offset | Data item | Length | Description |
|---|---|---|---|
| 07H | 02 | 1 | Multi-point connection command |
| 08H-09H | COLOUR | 2 | Color |
| 10H-11H | X0 | 2 | X coordinate of the first point |
| 12H-13H | Y0 | 2 | Y coordinate of the first point |
| 14H-15H | X1 | 2 | X coordinate of the second point |
| 16H-17H | Y1 | 2 | Y coordinate of the second point |
| … | … | … | … |
| * | XN | 2 | X coordinate of the Nth point |
| * | YN | 2 | Y coordinate of the Nth point |
17.6 Hollow rectangle
As per instruction: EE B1 10 00 00 00 01 03 01 FF 00 32 00 32 00 C8 00 C8 FF FC FF FF, it indicates that in the basic graphic control with ID 1 on page 0, a hollow rectangle is drawn using color 0x01FF, with the upper left corner at screen coordinates (50,50) and the lower right corner at screen coordinates (200,200).
| Offset | Data item | Length | Description |
|---|---|---|---|
| 07H | 03 | 1 | Hollow rectangle command |
| 08H-09H | COLOUR | 2 | Color |
| 10H-11H | X0 | 2 | X coordinate of the upper left corner |
| 12H-13H | Y0 | 2 | Y coordinate of the top left corner |
| 14H-15H | X1 | 2 | X coordinate of the bottom right corner |
| 16H-17H | Y1 | 2 | Y coordinate of the bottom right corner |
17.7 Solid rectangle
As per the instruction: EE B1 10 00 00 00 01 04 01 FF 00 32 00 32 00 C8 00 C8 FF FC FF FF, it indicates that in the basic graphic control with ID 1 on the 0th page, a solid rectangle is drawn using color 0x01FF, with the top left corner at screen coordinates (50,50) and the bottom right corner at screen coordinates (200,200)
| Offset | Data item | Length | Description |
|---|---|---|---|
| 07H | 04 | 1 | Solid Rectangle Command |
| 08H-09H | COLOUR | 2 | Color |
| 10H-11H | X0 | 2 | X-coordinate of the upper left corner |
| 12H-13H | Y0 | 2 | Y-coordinate of the upper left corner |
| 14H-15H | X1 | 2 | X coordinate of the lower right corner |
| 16H-17H | Y1 | 2 | Y coordinate of the lower right corner |
17.8 Hollow ellipse
As per the instruction: EE B1 10 00 00 00 01 05 01 FF 00 32 00 64 00 96 00 FA FF FC FF FF, it indicates that in the basic graphic control with ID 1 on the 0th page, the color 0x01FF is used to draw an inscribed hollow ellipse (inscribed hollow circle) within a rectangle with the upper left corner at screen coordinates (100,50) and the lower right corner at screen coordinates (250,150).
| Offset | Data item | Length | Description |
|---|---|---|---|
| 07H | 05 | 1 | Hollow ellipse (hollow circle) command |
| 08H-09H | COLOUR | 2 | Color |
| 10H-11H | Y0 | 2 | Y coordinate of left boundary |
| 12H-13H | X0 | 2 | X coordinate of upper boundary |
| 14H-15H | Y1 | 2 | Y coordinate of right boundary |
| 16H-17H | X1 | 2 | X coordinate of the lower boundary |
17.9 Solid ellipse
As per the instruction: EE B1 10 00 00 00 01 06 01 FF 00 32 00 64 00 96 00 FA FF FC FF FF, it indicates that in the basic graphic control with ID 1 on the 0th page, the color 0x01FF is used to draw an inscribed solid ellipse (inscribed solid circle) within a rectangle with the top left corner at screen coordinates (100,50) and the bottom right corner at screen coordinates (250,150).
| Offset | Data item | Length | Description |
|---|---|---|---|
| 07H | 06 | 1 | Solid ellipse (solid circle) instruction |
| 08H-09H | COLOUR | 2 | Color |
| 10H-11H | Y0 | 2 | Y coordinate of left boundary |
| 12H-13H | X0 | 2 | X coordinate of upper boundary |
| 14H-15H | Y1 | 2 | Y coordinate of right boundary |
| 16H-17H | X1 | 2 | X coordinate of lower boundary |
17.10 Crop image
As per instruction: EE B1 10 00 00 00 01 07 00 02 00 32 00 32 00 68 00 68 00 C8 00 C8 FF FC FF FF, it indicates that in the basic graphic control with ID 1 on the 0th page, starting from the screen coordinates (50,50), the content between the image coordinates (100,100) and (200,200) in image 2 is displayed.
| Offset | Data item | Length | Description |
|---|---|---|---|
| 07H | 07 | 1 | Crop image instruction |
| 08H-09H | IMAGE_ID | 2 | Image ID |
| 10H-11H | X | 2 | X coordinate of image display position |
| 12H-13H | Y | 2 | Y coordinate of image display position |
| 14H-15H | SX | 2 | Display starting from SX coordinate within the image |
| 16H-17H | SY | 2 | Display starting from SY coordinate within the image |
| 18H-19H | W | 2 | Width of image display |
| 20H-21H | H | 2 | Height of image display |
Leave a Reply