⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guidemo_polygon.c

📁 ucgui源码3.32
💻 C
字号:
/***********************************************************************************************************                                                uC/GUI*                        Universal graphic software for embedded applications**                       (c) Copyright 2002, Micrium Inc., Weston, FL*                       (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH**              礐/GUI is protected by international copyright laws. Knowledge of the*              source code may not be used to write a similar product. This file may*              only be used in accordance with a license and should not be redistributed*              in any way. We appreciate your understanding and fairness.*----------------------------------------------------------------------
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 + -