Autoscale Omnia II problem

kohle

Active Member
Licensed User
Longtime User
Hi,

I have a form with a blist object and some image buttons at the
botton (button.top = 225) of my form (Screensize : 320 x 240 )

I compiled with device + autoscale.

The blist object is ok, but the image buttons are not at the correct position.
They are to much up

Omnia : 800 x 480 , it should run on a 320 x 240 device too.

ScreenScaleX = 2
ScreenScaleY = 2

What can I do ?
 
Last edited:

eww245

Member
Licensed User

They are in a higher location because autoscale calculates for QVGA and VGA. You should use (Form.Height - 95)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
If I understand correctly you are designing the layout on the desktop. In that case you should set the form size (Designer form - Tools - Screen Size) to 240 x 400.
AutoScale feature doesn't change the layout of the form. So if you design your form for a 240x320 screen then it will look identical on 480x640 screens as well. But on a 480x800 you will get some empty space at the bottom.
 

kohle

Active Member
Licensed User
Longtime User
Ok this I understand. I want to develop a software which runs on all screen sizes
(320 x 240, 480 x 800 ...),
and my image buttons should be always at the same bottom line.

I can compile without autoscale and position the objects by my own.
So autoscale it´s much easier. Can´t I reposition the objects depending on
the (formsize * screenscale) = screensize and calculating a factor to reposition.
Did somebody do this yet ?
 

kohle

Active Member
Licensed User
Longtime User
In my case I tested with a htc touch 3g 320x240 and an omnia 2 800x480

First I changed the screen size to 400 x 240
In my project I use only ImageButtons as menu.

I use the following code in my sub app_start :

Controls() = GetControls("")
For i = 0 To ArrayLen(Controls())-1
Select ControlType(Controls(i))
Case "ImageButton"
Control(Controls(i)).Top = form1.Height - Control(Controls(i)).height - 5
End Select
Next

I compile the my project with autoscale.
It works fine on both resolutions (phones).
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…