化弧线的-emWin5.12使用方法

2024-01-02 18:14:51

1.

2.

void DrawArcScale(void) {
 int x0 = 160;
 int y0 = 180;
 int i;
 char ac[4];
 GUI_SetBkColor(GUI_WHITE);
 GUI_Clear();
 GUI_SetPenSize( 5 );
 GUI_SetTextMode(GUI_TM_TRANS);
 GUI_SetFont(&GUI_FontComic18B_ASCII);
 GUI_SetColor(GUI_BLACK);
 GUI_DrawArc( x0,y0,150, 150,-30, 210 );
 GUI_Delay(1000);
 for (i=0; i<= 23; i++) {
 float a = (-30+i*10)*3.1415926/180;
 int x = -141*cos(a)+x0;
 int y = -141*sin(a)+y0;
 if (i%2 == 0)
 GUI_SetPenSize( 5 );
 else
 GUI_SetPenSize( 4 );
 GUI_DrawPoint(x,y);
 if (i%2 == 0) {
 x = -123*cos(a)+x0;
 y = -130*sin(a)+y0;
 sprintf(ac, "%d", 10*i);
 GUI_SetTextAlign(GUI_TA_VCENTER);
 GUI_DispStringHCenterAt(ac,x,y);
 }
 }
}

文章来源:https://blog.csdn.net/weixin_48434590/article/details/135345055
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。