Computer Graphics

Moderators: Sephiroth
Number of threads: 1263
Number of posts: 2665

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
VC++ Graphics Help Posted by gameplayer on 4 Jul 2008 at 3:19 AM
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.
Report
Re: VC++ Graphics Help Posted by AsmGuru62 on 4 Jul 2008 at 4:14 AM
: 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.
:
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.
Report
This post has been deleted. Posted by vpvp on 10 Sept 2008 at 6:37 PM
This post has been deleted.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.