Drawing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kelvin.koogan@googlemail.com

    Drawing

    In my application I'm doing some drawing in my OnPaint routine using
    Graphics->DrawRectangl e. The rect bounds are constant and not scaled
    in anyway.

    One of our Chinese customers is seeing the rectangles appear in the
    wrong place. When I started investigating this I found that I got the
    same problems if I changed my Windows DPI settings from 96 to 120.
    However the customer tells me that they are using 96 DPI.

    Are there any other settings which could cause this problem? They say
    it's the same whatever screen resolution they use.

    Also is there anyway to calculate the rectangle positions such that
    they will always be write no matter what the users Windows settings
    are?

    TIA,
    KK
  • Jack Jackson

    #2
    Re: Drawing

    On Fri, 18 Jul 2008 12:59:26 -0700 (PDT), kelvin.koogan@g ooglemail.com
    wrote:
    >In my application I'm doing some drawing in my OnPaint routine using
    >Graphics->DrawRectangl e. The rect bounds are constant and not scaled
    >in anyway.
    >
    >One of our Chinese customers is seeing the rectangles appear in the
    >wrong place. When I started investigating this I found that I got the
    >same problems if I changed my Windows DPI settings from 96 to 120.
    >However the customer tells me that they are using 96 DPI.
    >
    >Are there any other settings which could cause this problem? They say
    >it's the same whatever screen resolution they use.
    >
    >Also is there anyway to calculate the rectangle positions such that
    >they will always be write no matter what the users Windows settings
    >are?
    >
    >TIA,
    >KK
    The pixel values you specify when drawing don't change, so my guess is
    that with changing DPI (and perhaps other things) .NET is scaling the
    form and its controls. See Form.AutoScaleM ode.

    You could set AutoScaleMode to None, but that might make your forms
    smaller than the users would like on computers with an increased DPI.

    You don't say what the purpose of your drawing is, or what is not
    "right" about it, but maybe you could adjust your drawing depending on
    the location and sizes of controls on the form, so when the controls
    are moved or resized by the scaling your drawing still looks OK.

    Comment

    Working...