[Gambas-user] Screen positions vary with resolution

Benoît Minisini gambas at ...1...
Wed Apr 25 11:04:58 CEST 2012


Le 17/04/2012 08:36, Rolf-Werner Eilert a écrit :
>
> Good morning Benoit,
>
> After thinking this over and trying around a bit this morning, I guess I
> finally understood (sometimes I'm somewhat slow :-) )
>
> With the higher resolution the fonts are enlarged to keep everything
> comfortable and readable. Then all elements in the form are enlarged by
> the same factor to keep the form about the same real-world size it had
> before. My labels, however, still refer to actual XY screen pixels.
>
> I looked into another project this morning and found the same thing:
> forms have been enlarged, fonts are wider, but not every graphic element
> can follow (e. g. there is a photo shown, and it scales too small as the
> frame is shown wider now).
>
> Trying to set this form's (Scaled) to FALSE didn't help, everything
> stays large. Do you have any idea what else I could try to keep
> everything as large as it was created for SXGA?
>
> On the other hand, I don't mind forms adapting to screen resolution, but
> then I will need to somehow read their scaling factor (for such things
> as the photo for instance). Is there any function for it?
>
> Thanks for your help.
>
> Regards
>
> Rolf
>

You must use MoveScale() and ResizeScaled() when creating controls 
manually, instead of Move() and Resize(). These functions just multiply 
their arguments by the scale factor (which is Desktop.Scale).

Regards,

-- 
Benoît Minisini




More information about the User mailing list