6.01 bug?

Discussion in 'Questions (Windows Mobile)' started by robmh, Dec 31, 2007.

  1. robmh

    robmh Member Licensed User

    Hi

    An "old" program ran fine
    1. on the device (compiled under 5.xx),
    2. on the device run from B4PPC 6.01 and
    3. on the desktop under 6.01

    I then compiled it under 6.01 and copied it to the device.

    Here it ran OK but all dimensions except for text seemed to be halved i.e. all buttons were half height/width and the forms only occupied a quarter of the screen.

    Note that I have a VGA device.

    Is this a bug or am I doing something wrong?

    Thanks in advance for any help.
     
  2. Put Claude

    Put Claude Active Member Licensed User

    Hi Erel,

    I have this also, on the Acer n300 WM5 640x480 resolution: do not now what to do with it...

    Put Claude Belgium

    P
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    .Net CF 2.0 applications (like the optimized executables) do not use the pixel doubling method.
    Which means that you can now take advantage of the high resolution screen.
    You have two options. You can change the Visual Designer screen size to 640 * 480 and create a VGA version.
    Or you can use the nonoptimized compiler and create a .Net 1.0 application.
     
  4. robmh

    robmh Member Licensed User

    More questions ...

    OK thanks.

    This creates a problem though.

    When developing on the device "pixel doubling" takes place when the program is Run from within B4P i.e. if a I develop on the device then compile on the desktop the program will behave differently.

    Also, can you offer advice on how do to develop the program to support non-VGA and VGA devices. Would I have two sbp files which just contain just user interface code and have a shared txt file with the rest of the code?

    BTW, I need to use .NET 2 as I'm using SQL.
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Nonoptimized executables will use pixel doubling whether running under .Net CF 2.0 (with the config file) or under .Net CF 1.0.
    So it is possible to use SQL with a nonoptimized executable.

    If you do want to deal with the different resolutions then check Form.Width / Form.Height properties at runtime and change the layout if necessary.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

  7. uskomp

    uskomp Member Licensed User

    scaling of controls

    Hi
    A small procedure for resizing all controls (it isn't the best solution but ...)

    ' from QVGA to VGA
    SkalujForm("Form1", 2)
    SkalujForm("Form2", 2)
    ..................


    Sub SkalujForm(sform,i)
    mycontrols()=GetControls(sform)
    For n=0 To ArrayLen(mycontrols())-1
    Control(mycontrols(n)).Top=Control(mycontrols(n)).Top*i
    Control(mycontrols(n)).Left=Control(mycontrols(n)).Left*i
    Control(mycontrols(n)).Height=Control(mycontrols(n)).Height*i
    Control(mycontrols(n)).Width=Control(mycontrols(n)).Width*i
    If ControlType(mycontrols(n))="Image" Then
    Else
    Control(mycontrols(n)).FontSize=Control(mycontrols(n)).FontSize*i
    End If
    Next
    Control(sform).Refresh
    End Sub
     
  8. robmh

    robmh Member Licensed User

    Thanks

    Thankyou for you help and comments.
     
  9. Put Claude

    Put Claude Active Member Licensed User

    hi uskomp,

    very very good idee for personel use, it works !!!

    Put Claude Belgium
     
  10. kyto

    kyto Member Licensed User

    Example?

    Hi uskomp.
    Thanks for this idea.
    Can you post a (little) example (source code) please?
    Newbies (as me) will be appreciating.
    Thanks!
     
  11. uskomp

    uskomp Member Licensed User

    Source code for scalling forms

    Free source code
     

    Attached Files:

  12. kyto

    kyto Member Licensed User

    Thanks...

    :) Thanks uskomp!
     
Loading...