Actually Paul, here's a snippet using Bresenhams...

void PlotCircle( Int16 x, Int16 y, Int16 x1, Int16 y1 )
{
        WinDrawPixel( x + x1, y + y1 ) ;
        WinDrawPixel( x - x1, y + y1 ) ;
        WinDrawPixel( x + x1, y - y1 ) ;
        WinDrawPixel( x - x1, y - y1 ) ;
        WinDrawPixel( x + y1, y + x1 ) ;
        WinDrawPixel( x - y1, y + x1 ) ;
        WinDrawPixel( x + y1, y - x1 ) ;
        WinDrawPixel( x - y1, y - x1 ) ;
}

static void DrawCircle( Int16 x, Int16 y, Int16 r )
{
        Int16 x1, y1, p ;

        x1 = 0 ;
        y1 = r ;

        p = 3 - 2 * r ;

        while ( x1 < y1 )
        {
                PlotCircle( x, y, x1, y1 ) ;
        
                if ( p < 0 )
                   p = p + 4 * x1 + 6 ;
                else
                {
                   p = p + 4 * ( x1 - y1 ) + 10 ;
                   y1 = y1 - 1 ;
                }
                x1 = x1 + 1 ;
        }
        if ( x1 == y1 )
                PlotCircle( x, y, x1, y1 ) ;
}


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to