473,574 Members | 2,817 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple (?) graphics question

I've never done any graphics before and am experimenting. I tried to draw a
circle using the graphics.DrawEl lipse() method, something like this:
DrawEllipse(myP en, 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 1390
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******** ******@TK2MSFTN GP15.phx.gbl...
I've never done any graphics before and am experimenting. I tried to draw
a circle using the graphics.DrawEl lipse() method, something like this:
DrawEllipse(myP en, 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2248
by: Jason Swett | last post by:
I want to do graphics with C++. Surprisingly, so far nobody has been able to tell me anything helpful. How do I do it? Any input would be greatly appreciated. Jason
1
1321
by: Support | last post by:
Hello: Using asp.net (vb) and I dont want to use active X controls - just server side code. I have uploaded a gif file but I want to resample it to a smaller size like 100 by 100 and save it to a file - simple ? right ? Upload -> Original.gif resample save as ->resampled.gif
5
1576
by: fripper | last post by:
I have a VB 2005 app ... main window has a picture box control (picControl) .... I want to draw a rectangle in that control using GDI+ ... something like: Dim g as graphics = creategraphics|() Dim r as Rectangle Dim b as new system.drawing.solidbrush(system.drawing.color.red) r.x = 100 r.y = 100
4
1427
by: pcnerd | last post by:
I originally asked this question in the "classic" VB forum. It occured to me after I had sent it that I sent it to the wrong forum. Anyway! Here's the situation. I have VB.NET 2005 Express Edition. I have a 19" LCD monitor with the resolution set at 1280 by 1024. I want to create a graphics program, say, displaying fractals that will run...
5
1408
by: Tim | last post by:
hi I used to do this Dim gfx As System.Drawing.Graphics = pic1.CreateGraphics gfx.FillEllipse blah blah blah to draw straight onto a form. but this is frowned up (slow).
6
3236
by: Chris Dunaway | last post by:
The method for printing documents in .Net can be confusing, especially for newer users. I would like to create a way to simplify this process. My idea would be implemented using a PrintDocument (much like the current model), but my PrintDocument would have a Pages collection such that each time you need to have an additional page, you would...
15
1824
by: Hamed | last post by:
Have I posted the message to wrong newsgroup? Or Does the question is so much strage? Would someone please kindly direct me to a true newsgroup or resource? Best Regards Hamed
7
1735
by: Delme Greening | last post by:
I have an empty project with a button on a form. What code do I need to put behind the button to draw a rectangle on my form when it is clicked?
4
3104
by: Carsten Schmitt | last post by:
Hello, I want to draw a simple pixel (i.e. a red pixel in the center of the screen), which is always in the foreground - even when running a fullscreen application like a DirectX game. I need this as an easy entry for programming later a HUD, which shows several informations, like date, time, company logo, etc. Any help or just a...
1
1470
by: James Willmott | last post by:
If I have a question, about how to implement a graphics algorithm in C++, but not specifically related to getting the graphics on screen (that I can work out for myself). Would asking for help in the implemention ( asking things like whether I should use std::vector vs std::list for example ) be off topic here? Thanks, jw.
0
7832
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8262
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8129
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6498
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3768
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3785
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2262
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1094
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.