- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ?
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Perhaps Bill could show some of his code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »