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:
Gui_dispstring ("")
Parameters: The text you want to display
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:
- Normal text: Gui_textmode_normal
- Invert text: Gui_textmode_reverse
- Transparent text: Gui_textmode_trans
- Xor text: Gui_textmode_xor
- 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)