?? guidemo_polygon.c
字號:
/*************************************************************************************************************
uC/GUI
嵌入式通用圖形軟件
File : GUIDEMO_Polygon.c
Purpose : Several GUIDEMO routines
*************************************************************************************************************/
#include "GUI.H"
#include "GUIDEMO.H"
#define countof(Obj) (sizeof(Obj)/sizeof(Obj[0]))
/*************************************************************************************************************
* Static data
*************************************************************************************************************/
static const GUI_POINT _aArrow[] = {
{ 0, - 5 },
{-40, -35 },
{-10, -25 },
{-10, -85 },
{ 10, -85 },
{ 10, -25 },
{ 40, -35 }
};
static const GUI_POINT _aTriangle[] = {
{ 0, 0 },
{-30, -30 },
{ 30, -30 },
};
static GUI_POINT _aiCursor[] = {
{ 0, 0 },
{ 50, 100 },
{ 0, 90 },
{-50, 100 },
};
/*************************************************************************************************************
* Typedefs
*************************************************************************************************************/
typedef struct {
float Angle;
int DoClear;
} tDrawContext;
/*************************************************************************************************************
* GUIDEMO_DemoPolygon
*************************************************************************************************************/
void GUIDEMO_DemoPolygon(void) {
int XMid = LCD_GetXSize() / 2;
int YMid = LCD_GetYSize() / 2;
GUIDEMO_ShowIntro("Arbitrary Polygons",
"Standard and antialiased");
GUI_SetColor(GUI_WHITE);
GUI_SetFont(&GUI_FontComic18B_1);
#if GUIDEMO_LARGE
GUI_DispStringAt("Arbitrary\nPolygons", 0, 0);
#endif
GUI_FillPolygon(&_aArrow[0], 7, XMid - 50, YMid + 40);
GUI_FillPolygon(&_aArrow[0], 7, XMid + 50, YMid + 40);
GUI_SetColor(GUI_GREEN);
GUI_FillPolygon(&_aTriangle[0], 3, XMid, YMid + 60);
GUI_SetColor(GUI_WHITE);
GUI_AA_EnableHiRes();
GUI_FillPolygonAA(&_aiCursor[0], 4, XMid * 3, (YMid - 40) * 3);
GUIDEMO_Wait();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -