🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #492

Re: Canvas Class Support for Drawing Circles

#492
From: Rijvordt EGK
Date: Mon, 17 Aug 1992 08:42
36 lines
1405 bytes
sriram@brc.uconn.edu (Chittathoor M. Sriram) writes:


>Hi,
>	Could someone point me as to how I can draw Circles using 
>	the canvas provided operations. The Canvas class provided
>	methods for drawing Rectangles, Lines etc. 

>	I saw one method which said ::curve_to. It accepts 
>	6 parameters. But I am not sure what these signify or 
>	is there any other method I have to use.


This will draw a circle.  It is not very pretty for small circles, but it works.

        Coord dy = radius_ * 4/3;
        canvas->new_path();
        canvas->move_to(  x - radius_,  y );

        canvas->curve_to( x + radius_,  y,
                          x - radius_,  y + dy,
                          x + radius_,  y + dy );

        canvas->curve_to( x - radius_,  y,
                          x + radius_,  y - dy,
                          x - radius_,  y - dy );

        canvas->close_path();
        canvas->stroke( color_, brush_ );


>	Thanks for any pointers.

>Sriram

                                -Edwin (erijvor@cs.vu.nl)
Technical Details
Message-ID: <15769@star.cs.vu.nl>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!star.cs.vu.nl!erijvor
References: <9208152211.AA10781@sparc0.brc.uconn.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!star.cs.vu.nl!erijvor
From: erijvor@cs.vu.nl (Rijvordt EGK)
Newsgroups: comp.windows.interviews
Subject: Re: Canvas Class Support for Drawing Circles
Message-ID: <15769@star.cs.vu.nl>
Date: 17 Aug 92 08:42:59 GMT
References: <9208152211.AA10781@sparc0.brc.uconn.edu>
Sender: news@cs.vu.nl
Lines: 36