emWin画表盘界面


1、画码表
Or = 90;
Ox = 95;
Oy = 95;
for(i = 40; i >= 0; i--){
    a = (-30 + i * 6) * 3.1415926 / 180;
    X1 = Ox - (int)((Or - 6) * cos(a));
    Y1 = Oy - (int)((Or - 6) * sin(a));
    X2 = Ox - (int)((Or -20) * cos(a));
    Y2 = Oy - (int)((Or -20) * sin(a));
    GUI_AA_DrawLine(X1,Y1,X2,Y2);
}

2、画圆弧

angle = -30;
GUI_SetPenSize(3);
GUI_AA_SetFactor(3);
GUI_AA_DrawArc(Ox,Oy,Or+15,Or+15,angle,angle+240);
GUI_SetPenSize(20);
GUI_SetColor(color1);
GUI_AA_DrawArc(Ox,Oy,Or,Or,angle+3*(80 - value),angle+240);
GUI_SetColor(color2);
GUI_AA_DrawArc(Ox,Oy,Or,Or,angle,angle+3*(80 - value));











你可能感兴趣的:(emWin)