Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » does ImageCtrl position depends on dpi ?
does ImageCtrl position depends on dpi ? [message #24015] |
Thu, 17 December 2009 14:32  |
chickenk
Messages: 171 Registered: May 2007 Location: Grenoble, France
|
Experienced Member |
|
|
Hi everyone,
I design a small app under Ubuntu.
I am currently using the Layout Designer to design the layout of my app.
I want to display three images (successfully imported in my .iml) which are 32x32 pixels each, vertically, and with no margin between them, like this:
----
| 1 |
| |
----
| 2 |
| |
----
| 3 |
| |
----
On the layout designer, I create User Classes with ImgCtrl class and I make the borders touch themselves. I checked in the text content of the layout file, everything is alright, I have 32 pixels between each position.
But when launching the real app, I am disapointed to see they do not touch themselves anymore.
I then tried to change the DPI of my screen, and tada ! I can see that the relative position (in pixels) between the ImgCtrls is not the same.
I believe this is because we are dependent on the dpi when positioning images.
How can I solve my problem ?
Here is the illustration at 96 dpi (original):

And at 72 dpi (images correctly touch themselves)

Thanks,
Lionel
-
Attachment: at_96dpi.png
(Size: 5.95KB, Downloaded 865 times)
-
Attachment: at_72dpi.png
(Size: 5.41KB, Downloaded 1102 times)
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 19:24:25 CEST 2025
Total time taken to generate the page: 0.01003 seconds
|