CDC::Ellipse doesn't work properly
Hi everybody,
in a project of mine (VC++2010, MFC), I want to draw a circle using the CDC::Ellipse.
Wheh I draw a circle with CDC::Ellipse, I have noticed that the figure is not exactly a circle because it has not a constant radius. At 0° (periodicity = 45°) the radius has the value I want it to be, at 22.5° (periodicity = 45°) the radius has a value slightly bigger then the value I want it to be. It is a weird behavior that I can't explain. When I draw the same shape "manually", i.e. with a polyline, the figure is exactly a circle with the same value of radius at any point on the circumference.
Can anyone help me?
Thanks.
Re: CDC::Ellipse doesn't work properly
Do you want a circle according to pixels
or do you want a circle according to visible screen measurement ?
THe core issue here:
The aspect ratio of the assumed pixels the ellipse is being drawn at doesn't match the aspect ratio you are expecting.
CDC::Ellipse works with mapping mode coordinates. (by default this is pixel coordinates)
See CDC::GetAspectRatioFilter()
If that isn't helping you to correct, your display device may not be properly reporting to windows what it's aspect ratio is, you'll need manual intervention to adjust the coordinates in that case.
Re: CDC::Ellipse doesn't work properly
Quote:
Originally Posted by
MA7730
When I draw the same shape "manually", i.e. with a polyline, the figure is exactly a circle ...
How could polyline be *EXACTLY* a circle?
Anyway, could you please post screenshot to illustrate the issue?