Drawing a filled circle

This forum is for general developer support questions.
Post Reply
djg
Posts: 26
Joined: Sat Jan 26, 2013 5:00 pm

Drawing a filled circle

Post 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.
User avatar
polluks
Posts: 46
Joined: Tue May 19, 2015 6:30 pm
Location: Germany
Contact:

Re: Drawing a filled circle

Post by polluks »

User avatar
nbache
Beta Tester
Beta Tester
Posts: 1628
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: Drawing a filled circle

Post 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
User avatar
thomasrapp
Posts: 300
Joined: Sat Jun 18, 2011 11:22 pm

Re: Drawing a filled circle

Post 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.
djg
Posts: 26
Joined: Sat Jan 26, 2013 5:00 pm

Re: Drawing a filled circle

Post by djg »

Thanks for the info. I got it to work now.
Post Reply