Driver/ST7735S-0.96/graphics.c
/******************************************************************************
        Function description: draw circle
        Entry data:     x0, y0 center coordinates
                        r radius
        Return value: None
******************************************************************************/
Function description: draw circle
Entry data:     x0, y0 center coordinates
r radius
Return value: None
Function description : draw circle Entry data : x0 y0 center coordinates r radius Return value : None
void LCD_DrawCircle(u16 x0,u16 y0,u8 r,u16 color)
{
	int a,b;
	a=0;b=r;
	while(a<=b)
	{
		LCD_DrawPoint(x0-b,y0-a,color);             
		LCD_DrawPoint(x0+b,y0-a,color);             
		LCD_DrawPoint(x0-a,y0+b,color);             
		LCD_DrawPoint(x0-a,y0-b,color);             
		LCD_DrawPoint(x0+b,y0+a,color);             
		LCD_DrawPoint(x0+a,y0-b,color);             
		LCD_DrawPoint(x0+a,y0+b,color);             
		LCD_DrawPoint(x0-b,y0+a,color);             
		a++;
		if((a*a+b*b)>(r*r))
		{
                        b--;
		}
	}
}
void LCD_DrawCircle ( u16 x0 , u16 y0 , u8 r , u16 color ) { int a , b ; a = 0 ; b = r ; while ( a <= b ) { LCD_DrawPoint ( x0 - b , y0 - a , color ) ; LCD_DrawPoint ( x0 + b , y0 - a , color ) ; LCD_DrawPoint ( x0 - a , y0 + b , color ) ; LCD_DrawPoint ( x0 - a , y0 - b , color ) ; LCD_DrawPoint ( x0 + b , y0 + a , color ) ; LCD_DrawPoint ( x0 + a , y0 - b , color ) ; LCD_DrawPoint ( x0 + a , y0 + b , color ) ; LCD_DrawPoint ( x0 - b , y0 + a , color ) ; a ++ ; if ( ( a * a + b * b ) > ( r * r ) ) { b -- ; } } }
Function description: draw circle
Entry data:     x0, y0 center coordinates
r radius
Return value: None
Function description : draw circle Entry data : x0 y0 center coordinates r radius Return value : None
// int di; //3            //0            //1                 //2              //4                //5 //6  //7 //Determine whether the points to be drawn are too far away