新手上路
- 积分
- 34
- 金钱
- 34
- 注册时间
- 2016-6-13
- 在线时间
- 11 小时
|
1金钱
lcd.c中只有void LCD_Fill(u16 sx,u16 sy,u16 ex,u16 ey,u16 color)和void LCD_Color_Fill(u16 sx,u16 sy,u16 ex,u16 ey,u16 *color)函数有颜色填充功能,那我假如用LCD_Draw_Circle(80,270,20)画了一个以(80,270)为圆心,20为半径的圆,我要在这个圆里填充红色,应该怎么做?
|
最佳答案
查看完整内容[请看2#楼]
[mw_shl_code=c,true]//画实心圆
//x0,y0:坐标
//r半径
//color:颜色
void gui_fill_circle(u16 x0,u16 y0,u16 r,u16 color)
{
u32 i;
u32 imax = ((u32)r*707)/1000+1;
u32 sqmax = (u32)r*(u32)r+(u32)r/2;
u32 x=r;
gui_draw_hline(x0-r,y0,2*r,color);
for (i=1;isqmax)
{
// draw lines from outside
if (x>imax)
{
gui_draw_hline (x0-i+1,y0+x,2*(i-1),color);
...
|