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 ?
Well, I know how to do the subroutine calls, but
the problem is getting the right parameters, so that i get an accurate portrayal of the geometric figures.
Other than trial and error, of course.
is the pixel size exactly square?
How many pixels are in the default window?
Re aspect ratio problems: I admire your concern, which I share, and note that unfortunately a lot of people (youngsters) nowadays just don't seem to care.
But...have you actually tried it? I do it a lot (Quickwin that is) and never had any trouble--a circle always looked circular, no matter what size my window was. It could possibly be hardware dependent, though (my pixels are square, maybe not yours; just measure one of your windows to find out).
If you have tried it and find that the results are not right, post your code here along with a screen cap and then maybe someone here can help you.
Hi Dale -
Is that your name ? I used to know a Dale Boggs.
anyway, I did try it -
The default pixel allocation is 768 x 1024, a 3 to 4 ratio,
so that means with square pixels, my viewport limits should be
that, ratio, i.e. 15 by 20, or 90 by 120, whatever coords I want to use.
However, it still is not quite right, so I surmise I dont have "square" pixels.
I probably should just get a tape measuare, and see what the correction has to be.
The Fortran gurus really dont address this issue, unfortunately - - -
Is the aspect ratio of your monitor 4:3? That would be an older, TV-like tube. Most newer monitors are 1.6:1 or 1.78:1. For these, the "normal" resolution would be, e.g., 1680x1050 or 1366x768. But screen resolutions are set by software in the video card driver, not the hardware of your video screen. There is a user-configurable setting for your video card that usually enables quite a range of resolutions, and one of them should match the aspect ratio of your monitor.
My own monitor measures 18.6" wide x 11.6" high, that is an aspect ratio of 1.6. I use it at a resolution of 1680x1050, which is also an aspect ratio of 1.6. Hence, square pixels.
It appears to be hardware dependent - -
so I guess I have to bring a tape measure with me, and draw a square of say 600 X 600 pixels,
and see how that comes out, and adjust accordingly.
Thanks for your suggestions ! !
I agree with Daryl that Windows should take car of this for you if you ask for a square or a circle, with the same dimensions for width and height, you should get that.
That would be very difficult though -
because we are dependent upon whatever device on the user end being used to display it.
The only way around that is to have s "standardized" hardware display, but I dont see why
we would get that in the near future.
#8: "But you are not sure that the monitor used to display this resolution has "square" pixels ie 4/3 resolution on a 16/9 monitor may be enhanced to a full screen display with pixels deformation."
Quite true, but that's the whole idea I was trying to describe. If you pick a resolution aspect ratio that matches your screen aspect ration, then Windows will not distort the pixels, and they will be square. Then displayed circles will be round and squares will be square.
So Bill can draw a "square" and measure it to see if it really is square, and make an adjustment if he wants. But the result--if the adjustment is hard-coded in his program--will be subject to distortion when others use it on their own screen, or if Bill later makes an adjustment on his screen, or gets a new screen, etc. It is probably better just to manually set a screen resolution that matches the screen shape.
With reference to some answers.
I have never used QUICKWIN but I have application parts which draw graphics in Windows using GDI+ for 2D and OpenGL for 3D (both called from C++), but I have never identified such a problem and a circle is usually a circle. On a screen, pixels introduce 'discontinuous' geometry (and an image is always a bitmap) so a circle with a diameter of 10 pixels cannot appear as drawn with a compass on a paper sheet.
Well, "pixel" size might even be different for PRINTED documents than
it is for a graphic display device.
For example, if I were going to make a document for a formal presentation.
I am wondering if that is defined formally anywhere ?
For example, a circle might look like a circle on a graphic display, but
would the aspect ratio be the SAME when I print it out?
This was formerly an issue when I worked at JPL - - but maybe some standardization
has taken place since then. The actual number of pixels would be consistent of course,
so the issue is: "How big is a pixel?"
Well, then then X and Y pixels per inch have not been defined anywhere,
unless that is hardware dependent.
On a digital movie screen, one pixel would take up a good fraction of
an inch, I assume.
And it isnt even certain that the X and Y ratios are the same.
One would have to know that, to assure that the aspect ratio is correct.
Otherwise a 500 x 500 square would not have the right dimensions, for example.
You said earlier that you want the "shape" to be exact. Now you want the dimensions to be exact? That's a lot harder, because Windows doesn't know the physical dimensions of the display, only the number of pixels in X and Y. Unless there's something seriously wrong with the display, if you draw a circle it should be a circle.