Download the free trial version
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Beta Versions
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Beta Versions This forum is the place to discuss issues regarding Basic4ppc beta versions.

AutoScale Questions

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-08-2009, 02:34 PM
Basic4ppc Veteran
 
Join Date: Jul 2008
Location: Borchen, Germany
Posts: 420
Send a message via ICQ to corwin42
Awards Showcase
Beta Tester 
Total Awards: 1
Default AutoScale Questions

Hi,

I'm a bit confused about the AutoScale compile option. If I compile with AutoScale:

If I use form.Line() to draw on a form will the parameters be fixed automatically or must I multiply them with screenX/screenY?

I have a program that uses the ImageLib.Drawer and the Rectangle object to draw a few graphics. For this I calculate all coordinates relative to form.width and form.height. Are the coordinates for the rectangle object automatically fixed or not? I think they should not get fixed automatically for my program to work correctly.

What is with old libraries with custom controls. I think they won't fix anything automatically. Will they work with AutoScale if I just call them with all position and size parameters multiplied by scaleX and scaleY?

I think I have to try the WM Device Emulator to test my program with VGA. :-(

Greetings,
Markus
Reply With Quote
  #2 (permalink)  
Old 05-08-2009, 03:53 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,933
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

As long as all the controls used in your application support AutoScale you don't need to wory about it in your code. It is a way of running code written for QVGA screens on VGA screens without changing anything. The only thing you will see different on a VGA screen is that graphics quality is somewhat diminished and graphics text might rendered a slightly different width.

Only control authors need to worry about AutoScale. All the intrinsic controls in Basic4ppc version 6.76 are AutoScale aware and all my libraries, where necessary, will be reissued as AutoScale aware when the Basic4ppc version 6.80 is officially released.

Quote:
What is with old libraries with custom controls ... Will they work with AutoScale if I just call them with all position and size parameters multiplied by scaleX and scaleY?
They will need updating to be recognised as AutoScale aware controls. This is necessary in order to have their Left, Top Width and Height properties automatically adjusted and they may need some internal code changes as well. You can use them without them being updated but in an AutoScaled application you will need to resize and reposition them according to ScreenScaleX/Y as they won't be resized automatically. Other code involving them may need to changed depending upon the individual control.

Another reason you might need ScreenScaleX/Y is if you are writing your application to be both QVGA and VGA aware and want to do the screen resolution compensations yourself and are not going to AutoScale compile it.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #3 (permalink)  
Old 05-08-2009, 04:05 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 12,926
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Quote:
If I use form.Line() to draw on a form will the parameters be fixed automatically or must I multiply them with screenX/screenY?
The parameters will be fixed automatically.
Quote:
I have a program that uses the ImageLib.Drawer and the Rectangle object to draw a few graphics. For this I calculate all coordinates relative to form.width and form.height. Are the coordinates for the rectangle object automatically fixed or not? I think they should not get fixed automatically for my program to work correctly.
The new ImageLib library will handle correctly the scaling and look the same on VGA and QVGA devices.
Quote:
What is with old libraries with custom controls. I think they won't fix anything automatically. Will they work with AutoScale if I just call them with all position and size parameters multiplied by scaleX and scaleY?
All official libraries except of Sprite properly support AutoScale mode.
In most cases it is not complicate to update existing libraries to support this mode. Agraham has already updated several of his libraries. I hope that eventually most of the libraries will support it properly.
Quote:
I think I have to try the WM Device Emulator to test my program with VGA.
This is not something that can be avoided. Luckily such emulators are available for free: Download details: Microsoft Device Emulator 3.0 you will also need to download the VGA device image.
__________________
Basic4android documentation
Reply With Quote
  #4 (permalink)  
Old 05-09-2009, 12:00 AM
Basic4ppc Veteran
 
Join Date: Jul 2008
Location: Borchen, Germany
Posts: 420
Send a message via ICQ to corwin42
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Ok, I tested my program on the VGA Device Emulator and erverything looked as I expected. Everything got scaled correctly except for the Listview control from Filippo which is currently not updated for AutoScale.

I only had to multiply the coordinates for the Listview control with ScreenScaleX and ScreenScaleY and everything looks good on VGA and QVGA.

There is only one thing: The graphics I do with Imagelib (mainly rectangles) look blurred in VGA. Is this normal? I will test it on a real VGA device next week to see how it looks there.

Greetings,
Markus
Reply With Quote
  #5 (permalink)  
Old 05-09-2009, 09:10 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,933
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by corwin42 View Post
There is only one thing: The graphics I do with Imagelib (mainly rectangles) look blurred in VGA. Is this normal?
Yes. This is the effect I referred to "graphics quality is somewhat diminished" in my post above. It is because the QVGA sized bitmap you are drawing is being stretched to fit VGA resolution. In the AutoScale aware version of ControlsExDevice there will be a NativeImage control that you can use in an AutoScaled application to get VGA graphics quality if this is important to you, but your code will need to do its' own Bitmap size and drawing parameter corrections to suit the device you are on.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #6 (permalink)  
Old 05-16-2009, 09:22 PM
Basic4ppc Veteran
 
Join Date: Jul 2008
Location: Borchen, Germany
Posts: 420
Send a message via ICQ to corwin42
Awards Showcase
Beta Tester 
Total Awards: 1
Default

It seems that hardware.SIPHeight does not scale correctly in AutoScale applications.

I want to size a panel the same height as the area which is not overlapped by the SIP. I used the folllowing code to calculate the height (fMain is my form, pMain is my panel, hw is a hardware object):

Code:
  If hw.SIPEnabled Then
   FormHeight = fMain.Height - hw.SIPHeight
  
Else
   FormHeight = fMain.Height
  
End If
 
  pMain.Height=FormHeight
  pMain.Width=fMain.Width
On a QVGA device it works well. On a VGA device the SIPHeight is substracted twice from the FormHeight so the panel is too small.

I have to use
Code:
FormHeight = fMain.Height - (hw.SIPHeight / screenScaleY)
to get the correct height for the panel.

Greetings,
Markus

@agraham: Is the AutoScale aware library of ControlsExDevice available somewhere?
Reply With Quote
  #7 (permalink)  
Old 05-16-2009, 09:34 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,933
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by corwin42 View Post
@agraham: Is the AutoScale aware library of ControlsExDevice available somewhere?
It's ready but I want to test it against the release version of Basic4ppc v6.80 before posting it.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #8 (permalink)  
Old 05-17-2009, 07:27 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 12,926
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Hardware.SIPHeight will be fixed. Thanks.
__________________
Basic4android documentation
Reply With Quote
  #9 (permalink)  
Old 05-22-2009, 03:07 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,759
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

I have some trouble with AutoScale with the RectangleEx objects from the ImageLibEx library with the Width and Height parameters, their values become smaller than expected.
I think this will be fixed in the final version. But nevertheless I submit the problem.
Attached 2 programs, one showing the problem one without but with in code scaling.

Best regards.
__________________
Klaus
Switzerland
Reply With Quote
  #10 (permalink)  
Old 05-22-2009, 04:55 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,933
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

It's nothing to do with RectangleEx, it's a Form refresh problem. If in GraphicsAS you remove any references to ScreenScaleX/Y from lines 29 and 30 and change line 57 to "Form1.Refresh" then it will behave as you expect and the code will look identical to an unchanged QVGA app. That's the whole idea of autoScale.

If you were using ImageLib then ImageLib.Refresh would work because ImageLib.Refresh is Autoscale aware and so knows to refresh a larger area of a Form when AutoScaled on a VGA device.

The downside to AutoScale is in displaying graphics as they are zoomed from QVGA to VGA size and lose crispness as a result. I aim to get the best of both worlds with two new graphics controls in the next version of ControslExDevice. Attached is a help file extracted from that for the next version of ControlsExDevice describing how AutoScale works, its' limitations and the two new graphics controls.

I don't at the moment intend to make ImageLibEx AutoScale aware intending it to be used with the two new controls in full VGA applications or semi-AutoScale aware applications that take advantage of AutoScale for control layout but are resolution aware to obtain the highest graphics quality. Such applications will need to work in native graphics resolution so will be capable of using VGA co-ordinates when necessary rather than having some of the co-ordinates altered automatically so possibly causing confusion.
Attached Files
File Type: zip ControlsExDeviceHelp.zip (19.9 KB, 18 views)
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.

Last edited by agraham : 05-22-2009 at 04:58 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
AutoScale compilation mode and external libraries Erel Beta Versions 22 05-25-2009 11:13 AM
Agrahams Chart Librarie Autoscale Paulsche Beta Versions 3 05-06-2009 07:10 PM
Two Questions ceaser Questions (Windows Mobile) 2 12-21-2008 01:58 PM
Some questions newbie Questions (Windows Mobile) 9 12-18-2008 07:41 PM
More SQL questions HARRY Questions (Windows Mobile) 2 01-04-2008 11:15 AM


All times are GMT. The time now is 02:33 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0