| Author |
Circle looks bad
|
Drew Lane
Ranch Hand
Joined: May 13, 2001
Posts: 296
|
|
I'm trying to draw a good looking circle with fillOval(0,0,12,12) but it looks quite bad. It looks more like a rounded rectangle with little points sticking out. Even the "Instant Graemlins" in this message board look more circular. Am I doing something wrong or is this a limitation? Drew
|
 |
Kay Tracid
Ranch Hand
Joined: Mar 06, 2002
Posts: 148
|
|
hi, i think you should use antialising for smoother edges. sample1 sample2 (this are the first google results, keywords "java antialiasing") good luck kay
|
 |
raj madhuram
Ranch Hand
Joined: Oct 10, 2001
Posts: 71
|
|
Hi, It sure looks like a circle to me at 12x12. Maybe if you go smaller, it looks like a rounded rectangle. One way to make the circle look real smooth is to use anti-aliasing. Refer to the code attached. One shows a circle w/o anti-aliasing and the other with it. Hope that helps. regards, Raj
|
 |
Drew Lane
Ranch Hand
Joined: May 13, 2001
Posts: 296
|
|
Thanks for the suggestions, but I forgot to mention that I need this to work with Java 1.1, thus no Graphics 2D or Swing... Drew
|
 |
Nathan Pruett
Bartender
Joined: Oct 18, 2000
Posts: 4121
|
|
Well, then you'll have to fake antialiasing yourself... The following code doesn't do perfect antialiasing, but it should give you an idea of what to do...
|
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
|
 |
Drew Lane
Ranch Hand
Joined: May 13, 2001
Posts: 296
|
|
Thanks Nate, that does look a lot better. Although, I can still get a better looking circle in Photoshop. I might just load a transparent gif of a circle instead... Drew
|
 |
 |
|
|
subject: Circle looks bad
|
|
|