How to use basic graphical controls?

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

How to use basic graphical controls?

What is a basic graphic control?

How to use basic graphical controls?Figure

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:

OffsetData itemLengthDescription
00HEE1Frame header
01H-02HB1 102Instruction flag of basic graphic control
03H-04HSCREEN_ID2ID of the screen
05H-06HCONTROL_ID2ID of the basic graphic control
*Drawing instruction 1*Varies depending on the graphic
*Drawing instruction N*Depending on the graphic
Last 4 bytesFF FC FF FF4Frame 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:

OffsetData itemLengthDescription
00HEE1Frame head
01H-02HB1 102Command flags for basic graphic controls
03H-04HSCREEN_ID2ID of the screen
05H-06HCONTROL_ID2ID of the basic graphic control
07HCC1Append mode
*Drawing command 1*Varies depending on the graphic
*Drawing instruction N*Varies depending on the drawing
Last 4 bytesFF FC FF FF4Frame end

17.3 Clear display

The format of the clear drawing instruction is shown in the following table:

OffsetData itemLengthDescription
0HEE1Frame header
01H-02HB1 102Command flags for basic graphic controls
03H-04HSCREEN_ID2ID of the screen
05H-06HCONTROL_ID2ID of the basic graphic control
Last 4 bytesFF FC FF FF4Frame 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).

OffsetData ItemLengthDescription
07H011Straight Line Instruction
08H-09HCOLOUR2Color
10H-11HX02X-coordinate of the first point
12H-13HY02Y coordinate of the first point
14H-15HX12X coordinate of the second point
16H-17HY12Y 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).

OffsetData itemLengthDescription
07H021Multi-point connection command
08H-09HCOLOUR2Color
10H-11HX02X coordinate of the first point
12H-13HY02Y coordinate of the first point
14H-15HX12X coordinate of the second point
16H-17HY12Y coordinate of the second point
*XN2X coordinate of the Nth point
*YN2Y 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).

OffsetData itemLengthDescription
07H031Hollow rectangle command
08H-09HCOLOUR2Color
10H-11HX02X coordinate of the upper left corner
12H-13HY02Y coordinate of the top left corner
14H-15HX12X coordinate of the bottom right corner
16H-17HY12Y 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)

OffsetData itemLengthDescription
07H041Solid Rectangle Command
08H-09HCOLOUR2Color
10H-11HX02X-coordinate of the upper left corner
12H-13HY02Y-coordinate of the upper left corner
14H-15HX12X coordinate of the lower right corner
16H-17HY12Y 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).

OffsetData itemLengthDescription
07H051Hollow ellipse (hollow circle) command
08H-09HCOLOUR2Color
10H-11HY02Y coordinate of left boundary
12H-13HX02X coordinate of upper boundary
14H-15HY12Y coordinate of right boundary
16H-17HX12X 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).

OffsetData itemLengthDescription
07H061Solid ellipse (solid circle) instruction
08H-09HCOLOUR2Color
10H-11HY02Y coordinate of left boundary
12H-13HX02X coordinate of upper boundary
14H-15HY12Y coordinate of right boundary
16H-17HX12X 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.

OffsetData itemLengthDescription
07H071Crop image instruction
08H-09HIMAGE_ID2Image ID
10H-11HX2X coordinate of image display position
12H-13HY2Y coordinate of image display position
14H-15HSX2Display starting from SX coordinate within the image
16H-17HSY2Display starting from SY coordinate within the image
18H-19HW2Width of image display
20H-21HH2Height of image display
Related Tags
Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.