471,306 Members | 1,305 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 software developers and data experts.

Simple (?) graphics question

I've never done any graphics before and am experimenting. I tried to draw a
circle using the graphics.DrawEllipse() method, something like this:
DrawEllipse(myPen, 0,0,300,300). However, the "circle" came out a little
stretched, as if I had given it parameters for a rectangle instead of a
square.

I know this has something to do with the screen resolution; when I changed
the resolution using the Control Panel | Display settings, the amount of
distortion changed. I thought I could use the DpiX and DpiY properties to
tell me how to adjust, but they both showed "96". If I understand those
properties correctly, it seems there should be no distortion, since they are
equal.

Can someone tell me how to make my circles circular and avoid the stretching
effect?

Much obliged.
Jan 20 '06 #1
1 1314
Found a solution, in case anyone wants to know how this turned out. The
video height and width settings, in pixels, are buried somewhere in the
"system" namespace (can't remember where, off the top of my head, and my
code is not at hand.) The video width / height ratio should match the
physical width / height ratio. If they don't match, you get distortion.

You determine physical dimensions with a tape measure. Fortunately there are
only a few standard screen sizes out there.

There are three ways to eliminate the distortion.
1. Go to the Control Panel and change the display settings to something that
matches your physical screen.
2. Determine the physical width and height. Determine the video width and
height settings. Use them to determine a correction constant. Multiple your
X or Y coordinate (depending on how you calculated the constant) by the
constant.
3. Determine a constant by giving the user a slider control and redrawing
some figure. When the user likes the proportions of the figure determine a
correction constant from the slider setting.

"Geoff Pennington" <Ge******************@whs.mil.no_spam> wrote in message
news:uR**************@TK2MSFTNGP15.phx.gbl...
I've never done any graphics before and am experimenting. I tried to draw
a circle using the graphics.DrawEllipse() method, something like this:
DrawEllipse(myPen, 0,0,300,300). However, the "circle" came out a little
stretched, as if I had given it parameters for a rectangle instead of a
square.

I know this has something to do with the screen resolution; when I changed
the resolution using the Control Panel | Display settings, the amount of
distortion changed. I thought I could use the DpiX and DpiY properties to
tell me how to adjust, but they both showed "96". If I understand those
properties correctly, it seems there should be no distortion, since they
are equal.

Can someone tell me how to make my circles circular and avoid the
stretching effect?

Much obliged.

Jan 27 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Jason Swett | last post: by
5 posts views Thread by fripper | last post: by
5 posts views Thread by Tim | last post: by
6 posts views Thread by Chris Dunaway | last post: by
7 posts views Thread by Delme Greening | last post: by
4 posts views Thread by Carsten Schmitt | last post: by
1 post views Thread by James Willmott | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.