接着就是画表盘的分布点了。
void draw_dotline() //画格点
{
u8 i;
u8 rome[][3]={"12","1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11" } ; //表盘数字
int x1,y1,x2,y2,x3,y3;
for(i=0;i<60;i++)
{
x1 = (int)(100 + (sin(i * PI / 30) * 92));
y1 = (int)(100 - (cos(i * PI / 30) * 92));
x2 = (int)(100 + (sin(i * PI / 30) * 97));
y2 = (int)(100 - (cos(i * PI / 30) * 97));
GUI_Line(x1,y1+100,x2,y2+100,RED);
if(i%5==0)
{
x1 = (int)(100 + (sin(i * PI / 30) * 85));
y1 = (int)(100 - (cos(i * PI / 30) * 85));
x2 = (int)(100 + (sin(i * PI / 30) * 97));
y2 = (int)(100 - (cos(i * PI / 30) * 97));
GUI_Line(x1,y1+100,x2,y2+100,RED);
x3 = (int)(92 + (sin((i ) * PI / 30) * 80));
y3 = (int)(92 - (cos((i ) * PI / 30) * 80));
GUI_Show12ASCII(x3,y3+100,rome[i/5],YELLOW,BLACK);
}
}
} |