Page 1 of 1

Drawing a filled circle

Posted: Sun Nov 14, 2021 3:19 pm
by djg
Hi,

How do I draw a filled circle? I think I have to use AreaEllipse() and AreaInit() and AreaEnd().
I have read the documentation on these routines but I can't find an example anywhere.
A code example would probably help to explain what this documentation is on about.

Re: Drawing a filled circle

Posted: Mon Nov 15, 2021 12:28 am
by polluks

Re: Drawing a filled circle

Posted: Mon Nov 15, 2021 12:45 am
by nbache
- and make sure you scroll down somewhat to also read https://wiki.amigaos.net/wiki/Graphics_ ... Operations and https://wiki.amigaos.net/wiki/Graphics_ ... Operations - they look relevant also.

Best regards,

Niels

Re: Drawing a filled circle

Posted: Mon Nov 15, 2021 12:51 pm
by thomasrapp
The main thing to know about Area operations is that you need to set up a TmpRas and AreaInfo in the RastPort, otherwise those calls won't draw anything.

Then you can use AreaMove, AreaDraw and AreaEllipse just as you would use Move, Draw and DrawEllipse for simple drawing. At the end you have to call AreaEnd, then the area will be drawn and filled.

Here is a rather old example: https://thomas-rapp.homepage.t-online.d ... piechart.c

To draw a circle you just call AreaEllipse followed by AreaEnd.

Re: Drawing a filled circle

Posted: Mon Nov 15, 2021 10:44 pm
by djg
Thanks for the info. I got it to work now.