Drawing

K

kelvin.koogan

In my application I'm doing some drawing in my OnPaint routine using
Graphics->DrawRectangle. 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
 
J

Jack Jackson

In my application I'm doing some drawing in my OnPaint routine using
Graphics->DrawRectangle. 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.AutoScaleMode.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top