Post by Lars-Erik ÃsterudPost by Jamie"SCALED" if system settings differ from "PixelPerinch" which is what
your screen was at the time you designed the form, it will scale the
form to adjust it.
Most of my forms DO scale right. Also the "Label"s and the buttons.
But SOME labels gets to long (outside the form), and bitmap images
get to small (that is not a great problem, just looks smaller :-)
When displaying your bitmaps and things like it, check the
Screen.PixelsperInch and create a scale using the
Form.pixelsperinch property.
the end results will give you proper stretching sizes when painting
to the screen.
remember that form.pixelsperinch is what your screen was when you
designed it, and screen.pixelsperinch is what the users screen is.
so something like.
ScaleFactor := Screen.PixelsPerinch * FormPixelPerInch;
for most screens, this will come out to 1 or 0.99999 etc..
when doing a CopyRect or some kind of draw that stretches or
shrinks. you can use the scale factor to set the destination
size.
I always set up a scale factor for global use when ever the
WM_messages come in that indicate system settings have changed.
i just can't remember the message at the moment but, it's a
handy global factor to have in your code.
delphi uses the font information to create the scaling for the
forms and so on. I have found that for example, using japanese fonts
it creates incorrect values. this was an issue before i had corrected
it by editing the Tforms source code.
It's not really good to alter the VCL code because when porting your
app to different versions of Delphi or machines, you have to keep
editing your VCL code and you have to compile not using packages.
Post by Lars-Erik ÃsterudPost by Jamieso look at SCALE, Pixelsperinch and PrintScale properties in the
Is there a call to check the systems DPI setting in the Delphi API?
If I can't get the latest things fixed (the long label not scaling
and the images not scaling) I could do this manualle (change font
size, load an alternate image) IF I could check the DPI in some way
--
"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5