Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
16 Views

Q about graphics window setup

I have a QUICKWIN graphics setup, where I want the shape of an object to be exact.

For example, if I draw a circle, I want it to come out looking like a circle, not an ellipse.

And a square should look like a square, not a rectangle.

So this means setting up the proper parameters for SETWINDOW.

What is the easiest way to do that ?

0 Kudos
26 Replies
Highlighted
New Contributor I
4 Views

Well, when I draw a 600 x 600 square, on the screen, 

it does not quite come out right.

Off by about 10 per cent.

0 Kudos
Highlighted
New Contributor I
4 Views

Once again: measure the width and height of your screen (the viewing part), and compare that ratio to the screen resolution in pixels x and pixels y. If these ratios don't match, then your square will not be square. Have you tried this yet? Does it not explain the effect you see?

And yes, pixels do have a "shape," although that should be interpreted to mean the pixel SPACING has a shape: the pitch (space between pixels) in the x direction divided by the pitch in the y direction.

0 Kudos
Highlighted
Black Belt
4 Views

billsincl wrote:

Well, when I draw a 600 x 600 square, on the screen, it does not quite come out right. Off by about 10 per cent.

I did the following test using Matlab (I have Matlab 2012). I generated and plotted a sphere with the commands

>> [x,y,z]=sphere; surf(x,y,z)
>> axis equal

With my LCD monitor set at the normal 1980 X 1024 (aspect ratio = 1.78), the sphere did not look squashed (i.e., ellipsoidal). Keeping Matlab windows open, I changed the screen resolution to 1280 X 1024 (aspect ratio = 1.25) using the Windows control panel. After a couple of seconds with the screen blank, I could again see the spherical sphere in the Matlab figure window. I surmise that the graphics driver took care of the altered pixels aspect ratio and redrew the sphere correctly.

With respect to correct size: some monitors have an inch/cm scale embossed on the bezel, and an OSD setting to display a grid and/or standard photo size (5 X 7, 8 X 10, etc.) frames to make it possible to check.

0 Kudos
Highlighted
Black Belt
4 Views

Perhaps Bill could show some of his code.

0 Kudos
Highlighted
New Contributor II
4 Views

Hello Before setting the display resolution of your graphic card, you should check the physical resolution of your screen. Then you can set the display resolution to the screen resolution to avoid resizing by the screen. But even in this case, it's not guaranteed that your screen is isometric.
0 Kudos
Highlighted
New Contributor I
4 Views

Windows provide the system function GetDeviceCaps() to obtain a large number of characteristics of a device (screen, printer, etc.).
From MS documentation:
=========================================​=========================
int GetDeviceCaps( _In_ HDC hdc, _In_ int nIndex );
Parameters:
hdc [in]  A handle to the DC.
nIndex [in]  The item to be returned. This parameter can be one of the following values:

. . . . . .

ASPECTX  Relative width of a device pixel used for line drawing.
ASPECTY  Relative height of a device pixel used for line drawing.
ASPECTXY  Diagonal width of the device pixel used for line drawing

However the problems are probably related to some QUICKWIN setting.

0 Kudos
Highlighted
New Contributor II
4 Views

The problem is that these properties doesn't take in account the physical display device. They are only logical values. They are accurate for plotters and printers but not for display screens.
0 Kudos