Basically, I want to draw a circle using Graphics, but instead of using integers to position it, I would like to use double values instead.
Ideally:
g.drawOval(0.5, 0.5, 50, 50);
Any help is greatly appreciated! Thanks in advance!
Thanks for all the help guys, but ive figured a way out, my dy variable was set at 1, so if i wanted dx to half of that of dy, it would be impossible, instead i just changed dy to 2 and dx to 1! Foolish me!
The only valid way of doing this is to use an
Ellipse2D.Doubleshape and pass it to thedraw(Shape)method of aGraphics2Dinstance. For the best results, enable anti-aliasing:You can use
Graphics2D.fill(Shape)as well.