emWin顯示文本字符-【worldsing筆記】

emWin顯示文本字符仍是容易的,提供了各類不一樣的接口,下面是有關於字符顯示的經常使用的用法,能夠直接複製到VS2008的模擬ucGui(emWin模擬工程)中運行: ui

工程代碼下載:1.emWin5.26(ucGui)VS2008字符顯示 spa

 

#include "GUI.h" blog

#include "WM.h" 接口

 

#include "CHECKBOX.h" 字符串

#include "FRAMEWIN.h" it

#include "PROGBAR.h" io

#include "TEXT.h" 下載

#include "BUTTON.h" im

#include "SLIDER.h" img

#include "HEADER.h"

#include "GRAPH.h"

#include "ICONVIEW.h"

#include "LISTVIEW.h"

#include "TREEVIEW.h"

 

void MainTask(void) {

 

#if GUI_WINSUPPORT

WM_SetCreateFlags(WM_CF_MEMDEV);

#endif

GUI_Init();

#if GUI_WINSUPPORT

WM_MULTIBUF_Enable(1);

#endif

while(1)

{

    //當前位置顯示字符串

GUI_DispString("Hello world");

//在x=20,y = 20位置顯示字符串

GUI_DispStringAt("Hello world", 20, 20);

    //座標移動到x=100,y=100位置

GUI_GotoXY(100, 100);

//顯示字符'Q'

GUI_DispChar('Q');

//自動後移位顯示字符'Q'

GUI_DispChar('Q');

//在,位置顯示字符'P'

GUI_DispCharAt('P', 70, 45);

//x座標移動到,y不變

GUI_GotoX(60);

//顯示字符'#'

GUI_DispChar('#');

//y座標移動到,x不變

GUI_GotoY(60);

//顯示字符'@'

GUI_DispChar('@');

//座標移動到x=8,y=120位置

GUI_GotoXY(8, 120);

//顯示個字符'*'

GUI_DispChars('*', 6);

//座標移動到下個字符行

GUI_DispNextLine();

//顯示個'*'

GUI_DispChars('*', 6);

//在,位置以中心對齊顯示字符串

GUI_DispStringHCenterAt("GUI_DispStringHCenterAt", 220, 120);

}

}

 

單色屏(黃底黑字)運行的效果:

 

相關文章
相關標籤/搜索