I am new to graphics programming. My program requires that i draw a
grid of circles encased in a rectangle.
The window i use to display is of fixed size.
My problem occurs when i run the program under diff resoltution the drawing over flows my screen.Can some one give tips on how i can fix the
problem.
I need the size of my window to be constant even if the resolution is changed.Is it possible.
Comments
: grid of circles encased in a rectangle.
:
: The window i use to display is of fixed size.
:
: My problem occurs when i run the program under diff resoltution the
: drawing over flows my screen.Can some one give tips on how i can fix
: the
: problem.
:
: I need the size of my window to be constant even if the resolution
: is changed.Is it possible.
:
[color=Blue]You can do it if you use the independent units for the size of your circles. Say, use 0.001 inch to measure the circles and the convert the measurements from 0.001 inches to pixels using the GetDeviceCaps (hDC, LOGPIXEL_xxx) API.
Do you need the grid of circles being of constant row x column size? What do you mean by "need the size of my window to be constant"? If you have same pixels width and height of a window - it will look smaller on high resolutions and may not even fit on lower resolutions. So, you need to scale your window according to resolution? If so, use GetDeviceCaps() API and then calculate your sizes using MulDiv() function or float point operations.[/color]