-
November 13th, 2013, 12:25 PM
#1
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.
-
November 14th, 2013, 11:35 AM
#2
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.
-
November 21st, 2013, 04:10 PM
#3
Re: CDC::Ellipse doesn't work properly
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?
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|