Stm32+ucos-ii+uc/gui Porting (Uc/gui API function learning one)

Source: Internet
Author: User

For some time recently, I wanted to learn to transplant Ucgui. On the network to find a large number of transplant materials and learning tutorials, coupled with their continuous efforts, the successful completion of the transplant. Now will learn the problems encountered and has been recorded, the aspect of their own browsing, but also for beginners to provide a shortcut.

Uc/gui Basic functions:

    • display text on the LCD

Gui_dispstring ("")

Parameters: The text you want to display

    • Selected coordinates

Gui_gotoxy (x, y)

For example: at (10,10) coordinate point position, display Hello world! text

Gui_gotoxy (10,10);

Gui_dispstring ("Hello world!");

<1> Text API functions:

Text Drawing mode:

    1. Normal text: Gui_textmode_normal
    2. Invert text: Gui_textmode_reverse
    3. Transparent text: Gui_textmode_trans
    4. Xor text: Gui_textmode_xor
    5. Transparent inverted text: Gui_textmode_trans | Gui_textmode_reverse

<2> Value API

<3> Graphics Processing API

<4> fonts

The current Uc/gui version offers 4 fonts: equal width bitmap font, proportional bitmap font ...

To be able to use a font in your application, you must do the following:

    • Fonts in any of the three types of files, such as "C" files, project files or libraries, compatible with the Uc/gui specification
    • Font files linked to your app
    • The description of the font is to be included in the GUIConf.h (this is necessary in order to avoid compilation warnings that result from the absence of a declared external solid)

Font API

<5> Bitmap Conversion

Bitmaps that can be used for Uc/gui are typically defined as the GUI_BITMAP structure of "C", and bitmap converters are an easy-to-use Windows program. Just load a pair of bitmaps (. bmp format) into the program, convert the bitmap if necessary, and then save the result as a "C" file for Uc/gui to use so that the bitmap can be displayed on the screen.

An image must first be loaded as a bitmap in a. bmp format file, the bitmap converter cannot produce a "C" file from a bitmap in an RGB mode, and the following types of. bmp files can be loaded into the program:

    • Per-pixel 1,4 or 8-bit format with a palette
    • 24BPP without a palette
    • RLE4 and RLE8 formats

Rle:run-length Encoding Stroke length encoding, if your bitmap includes many pixel sequences of equal color, RLE compression method is effective.

The Uc-gui-bitmapconvert.exe bitmap converter software is available under the tool folder in the Ucgui source file

<6> pre-defined colors

In addition to custom colors, some standard colors are pre-defined in Uc/gui

Color API:

Stm32+ucos-ii+uc/gui Porting (Uc/gui API function learning one)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.