How to adapt a form size to HTC Touch HD 480x800

Discussion in 'Questions (Windows Mobile)' started by 2220, Nov 18, 2008.

  1. 2220

    2220 Member Licensed User

    Hello,

    I've sent my app to a customer and he have just bougth a HTC Touch HD.
    He doesn't see anything.

    How can I adapt the app to this resolution (480*800)?

    Must I resize all the app to this screen size?
    I though the app will take a 640x480 screen resolution, but no.

    Best regards.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You will need to rescale your controls. How come he don't see anything, if the resolution is higher than 480*640?
     
  3. 2220

    2220 Member Licensed User

    I must rescale the controls , positions and make images bigger.

    How can I know the resolution screen?
     
  4. Cableguy

    Cableguy Expert Licensed User

    You can check both form.width and formHeight and re-scale to a factor...

    Ie:
    Base scale for form width =240 (qvga)

    for a vga screen the scale would be the form.width/240, lets say 3.5...

    Then you wwould aply this to make the controls look the same regardless...

    Controlname.width=int(controlname width*3.5)

    For the posicion of the controls, I suggest to use a "virtual" grid, and rescale it acording to the screen size...

    Font size will be a mater or hard coding and experimenting...

    I hope to have helped...
     
    Last edited: Nov 19, 2008
  5. 2220

    2220 Member Licensed User

    Thank you very much.

    I'll try to apply your knowlegment.
     
  6. N1c0_ds

    N1c0_ds Active Member Licensed User

    Code:
    If Form.Width/Form.Height=3/4 Then...
    If it's bigger, it's not a normal portrait screen (QVGA,VGA)

    Now if your application also works in landscape:

    You could try something like that (please note the top and bottom bars are not counted when getting Form.Height. Thus a 320 pixels screen height will return 268. Each bar is 26 pixels high on QVGA screens or 52 pixels high on VGA screens.)

    Code:
    If Form.Width>Form.Height Then
     
    If Form.Width/Form.Height=240/268 Then
      [I]ScreenFormat=VGA 
    or QVGA (portrait)[/I]
     
    End If
    Else If Form.Width<Form.Height Then
     
    If Form.Width/Form.Height=320/188 Then
      [I]ScreenFormat=VGA 
    or QVGA (landscape)[/I]
     
    End If
    Else If Form.Width/Form.Height=240/188 Then
      [I]Screenformat=
    "Square screen"[/I]
    Else
      [I]Screenformat=
    "Other"[/I]
    End If

    Once you discover the size of the form, you can use Form.Height and Form.Width to align controls.
    Code:
    Control.Top=Form.Height-Control.Height
    will align your control to the bottom of the screen, for example.
     
    Last edited: Nov 20, 2008
  7. 2220

    2220 Member Licensed User

    Thanks again.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice