Jump to content

Why is the resulting circle defective?


Recommended Posts

Posted

Here's my code: gdispGFillCircle(g, 120, 120, 30, HTML2COLOR(0xFF8D1A));

And Anti-aliasing is turned on.    #define GDISP_NEED_ANTIALIAS                     GFXON

 

微信图片_20250603161940.jpg

Posted
11 hours ago, Joel Bodenmann said:

Hi,

Can you please provide more details? What do you consider to be defective?

As you can see, the resulting circle has some missing corners, how should I fix it?

8FD32DA9-63A8-4897-994F-97EE679FB8F5.png

Posted

Anti-aliasing is something that is currently only supported by font rendering. Circles (or any drawing operation other than fonts) are never anti-aliased. The reason for this is the amount of code and the complexity in the drawing operations make it not suitable for such a small graphics library as uGFX. Anti-aliasing operations are also very slow for most of the displays uGFX support because it requires reading back from the display frame-buffer, an operation that is very slow on many devices. Of-course, if your display is not capable of read-back (and many aren't), anti-aliasing will not work at all, even for fonts.

If you want to anti-alias your circle, a would suggest drawing a circle 1 pixel larger diameter in a color that is a blend between the circle color and the background color. Then draw you circle on top of that. That will have the effect of filling in the edge pixels.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...