1. Black Friday Sale - 50% off

    B4A Standard for $29 instead of $59!
    Buy Now
    Dismiss Notice

Working with VGA screens

Discussion in 'Tutorials' started by Erel, Feb 7, 2008.

  1. Erel

    Erel Administrator Staff Member Licensed User

    You shouldn't use the Forced QVGA mode.
    On the desktop you can change the screen size. Open a form and choose Tools - Screen Size.
  2. Rioven

    Rioven Active Member Licensed User

    Working on 480x800 screen resolution

    Hi Erel,
    Thanks a lot!
    Here are what I did:
    The form size was set to height=800 and width =480
    Working on desktop IDE...all controls was sized relative to form size. I have doubled the text size on controls temporarily to get WYSIWYG then put it back to real text size and then compile for device normally.

    Working with Device IDE I have done normally and runs WYSIWYG, but need work with subroutine code which doubling the control sizes and locations and activate this subroutine code on desktop before compiling for device normally.

    I hope I'm doing the right way. Any other suggestions?
    Last edited: Nov 16, 2008
  3. Erel

    Erel Administrator Staff Member Licensed User

    The device IDE runs in the same mode as Forced QVGA applications.
    I'm not familiar with your specific device but in this mode high resolution devices behave in the same way as low resolution devices by using a "pixel doubling" method.
    You can create a simple application that shows the width and height of a form.
    Compile it with the optimized compiler and run it on the device.
    Compare the results with the results you get when running it from the device IDE.
  4. Cableguy

    Cableguy Expert Licensed User

    HI guys...

    Enabled by the power of modules and the getcontrols keyword...I was able to put together this very small example and module (AutoAdjust)...

    Hope this will simplify the execution of QVGA designer apps NOT forced QVGA compiled, running in vga devices, enabling the auto resizing, and not have to have the config file and the default dll created in Forced QVGA compilation...

    This also enables that VGA targeted app can also run, within some limits, in QVGA screens withou having to redo the entire design...Just chnage the "default width in this calculaation:
    W=Round(Control(FormName).Width/240,1) '240 in QVGA Portrait Mode, 320 in QVGA Landscape Mode, Double those for VGA Modes..

    The limitations are that controls such as comboboxes and NumUpDown will not resiize properly in most cases...But I may be wrong...

    For the example I have posted both B4ppc source, and 2 exe's, one ForcedQVGA compiled, and one NOT QVGA compiled, but both Opti-complied...(hope to make sense...)

    @EREL, so far no "general use" Modules have been released...I think this is the first one...But perhaps a new sub forum in the samples would be something to think about in the near future....

    Attached Files:

    Last edited: Nov 20, 2008
  5. Erel

    Erel Administrator Staff Member Licensed User

  6. Cableguy

    Cableguy Expert Licensed User

  7. agraham

    agraham Expert Licensed User

    Here's another way of adapting a QVGA app to VGA using the Door library. Visual Studio 2005 adds this code automatically to a form laid out for a QVGA device so that the form scales up when run on a VGA device. VS2005 also adds the same code, but with the 96s replaced by 192s, for a form laid out for a VGA device so it scales down when run on a QVGA device.

    Obj1 and Obj2 are Door library objects. Args is a Door library ObjectArray.
    'Form1.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
    "System.Drawing.SizeF" & Obj2.System_Drawing, Args.Value)      
    "AutoScaleDimensions", Obj2.Value)   
    'Form1.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;   
  8. Rioven

    Rioven Active Member Licensed User

    :sign0060: From your code, I have added controls on form1, Compiled, tested, and works perfectly on my 480X800 screen! Wonderful!
    I'll implement this in all my apps.

    Thank you again!

  9. berndgoedecke

    berndgoedecke Active Member Licensed User

    Best way for VGA and QVGA

    I've tested your code too. It works great on my VGA- and my QVGA-device.
    Thank You.

    Best Regards

  10. showaco

    showaco Member Licensed User

    hehe, works great for me. I'm making a weather plugin for wm6.5 called TitaniumWeather and needed to add a radar option. This worked very good for making my controls vga/qvga without doubling pixels causing distortion on my vga device. Thanks:sign0060:
  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