Click here to Skip to main content
15,906,558 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
It has been my experience that each time I use the ellipse function, the ellipse/ circle drawn always have rough boundaries and this detracts from the quality of my applications. What must I do to ensure ellipse function draw ellipse or circles with smooth edges?

What I have tried:

I have spent so many hours googling for a solution but to no avail.
Posted
Updated 2-May-16 14:00pm
Comments
Patrice T 2-May-16 19:57pm    
Define "rough boundaries" and "smooth edges"
show some code
Gbenbam 3-May-16 3:05am    
By rough boundary I mean boundaries that have a degree of zig-zagging. By smooth edges (or boudaries) , I mean edges/boundaries that have no iota of zig-zaging.

1 solution

What you need is called spatial anti-aliasing; you need to understand how it works: Spatial anti-aliasing - Wikipedia, the free encyclopedia[^].

This CodeProject article can be helpful: Antialiasing Using Windows GDI[^].

See also: http://www.ucancode.net/faq/VC++_Drawing_Example.htm[^].

—SA
 
Share this answer
 
Comments
Gbenbam 3-May-16 8:27am    
Thanks for your solution. But I.believe you will agree with me that that not all questions require codes. How does one write code on anti-aliasing if he doesn't know what it is in the first place.Often times,all one needs is someone to point him in the right direction. Anyone who has used msdn for some time will know that documentation doesn't always have all the information. It it does there will be no need for googling, in fact there will be no need to join this forum. Besides, I think you need to be more patient with people on here. You can correct without sounding hash and critical. All you need do is soften the tone of your responses.

I remember one of my encounters with you.I had just joined code project and that was the first time I will join a forum. I used to use yahoo answers until some from yahoo answers gave me a link in CP that was how I discovered CP. Since I did not know how to use the forum I erroneously posted a reply to an answer as solution, and what did I get, a lambasting from you. Ironiously , it was another old member who guessed that I did not know the correct thing to do that instructed me on the right thing to do.Rather than lambast me that, in my opinion is what you should have done.I think you really should endeavour to be more patient and tolerant. In spite of it all , you remain the most helpful and resourcefull member of CP to me. Stay blessed.
Sergey Alexandrovich Kryukov 3-May-16 9:37am    
You are welcome; and I agree with you. Do you refer to my comment on using "What have I tried" on some other question? On this one, I did not say anything like that. In this case, you probably did not need to write anything in this section.

Yes, sometime you have a more or less idea on, say, some effect you want, and don't know how to call it, so the search needs some "bootstrap", which could be not so easy. This is where asking questions can help.

—SA
Gbenbam 3-May-16 10:00am    
Yes, I am referring to more to your comment in the other ellipse question.
Sergey Alexandrovich Kryukov 3-May-16 10:06am    
All right; I appreciate your suggestions.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900