这款GUI名称是uGUI, 官网:uGUI
源码: ugui v0.3.zip
官网展示的效果图都还不错。贴几张:
在emWIN的模拟器上来运行这个GUI:
将两个文件添加到工程,ugui.c ugui.h
在ugui.h进行修改:
1、屏蔽include "system.h"
2、
#if 0 #define __UG_CONST const typedef uint8_t UG_U8; typedef int8_t UG_S8; typedef uint16_t UG_U16; typedef int16_t UG_S16; typedef uint32_t UG_U32; typedef int32_t UG_S32; #else #define __UG_CONST const typedef unsigned char UG_U8; typedef signed char UG_S8; typedef unsigned short UG_U16; typedef signed short UG_S16; typedef unsigned int UG_U32; typedef signed int UG_S32; #endif
进行GUI的初始化:
/* for uGUI */ UG_GUI test_uGUI; void __draw_pixel(UG_S16 x, UG_S16 y, UG_COLOR color) { GUI_SetColor(color); GUI_DrawPixel(x, y); } /* end */ void MainTask(void) { WM_HWIN hWin; #ifdef WIN32 // WM_SetCreateFlags(WM_CF_MEMDEV); #endif WM_MOTION_Enable(1); WM_MULTIBUF_Enable(1); GUI_Init(); UG_Init(&test_uGUI, __draw_pixel, 480, 272); // initialize uGUI UG_SetForecolor(GUI_RED); UG_DrawCircle(100, 100, 50, GUI_RED); // draw a circle to test uGUI UG_FontSelect(&FONT_6X8); UG_PutString(50, 170, "I'm uGUI"); GUI_SetColor(GUI_RED); GUI_DrawCircle(230, 100, 50); // compare with uGUI GUI_DispStringAt("I'm emWin",180, 170); while (1) { GUI_Delay(50); } }
运行效果:
有兴趣的可以玩玩。