Thread: Keep look the same at different resolutions?

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    38

    Keep look the same at different resolutions?

    What methods are available to keep a Windows program looking the same despite the resolution they are run at?

    I'm writing a program on my computer with 1600x1200 resolution that, when run at a lower resolution, looks terrible. The button size and placement is off, the text looks anemic, and on one computer (that's actually at 1600x1200) some of my bitmaps are being clipped by the bottom of the window.

    How do you do it? Any suggestions?

    ________
    Rutabega

  2. #2
    Registered User
    Join Date
    Jul 2003
    Posts
    59
    I have not done this before and I dont know if it will work but since no one else have answered yet.. ill give it a try

    Save the number of pixels per logical inch on the computer that you develop on. You get it by using GetDeviceCaps with LOGPIXELSX and LOGPIXELSY.

    // pixels per logical inch you got above
    floag ppix = some value
    floag ppiy = some value

    Then at startup of your program get the current values and divide them with the saved ones.

    float deltax = ppix / current_ppix
    float deltax = ppiy / current_ppiy

    Now multiply all your controls positions with with theese values.

    Give it a try, but don't expect it to work 100% =)
    Try searching the codeguru forums, i've seen a couple of theese threads before.

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    38
    Thanks erikj,

    That actually did work about 99%, and the 1% you really don't notice unless you count pixels.

    ________
    Rutabega

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 800x600 res Applications..?
    By csonx_p in forum Windows Programming
    Replies: 31
    Last Post: 07-01-2008, 04:12 AM
  2. Replies: 4
    Last Post: 08-27-2007, 05:59 AM
  3. Graphics: Dealing with multi resolutions?
    By Kurisu33 in forum Windows Programming
    Replies: 3
    Last Post: 10-02-2006, 12:05 AM
  4. SDL_FillRect problem
    By Frost Drake in forum Game Programming
    Replies: 4
    Last Post: 09-16-2006, 09:32 PM
  5. new year resolutions
    By iain in forum A Brief History of Cprogramming.com
    Replies: 32
    Last Post: 12-28-2001, 02:15 PM