![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Beta Versions This forum is the place to discuss issues regarding Basic4ppc beta versions. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
The new version includes an important new compilation mode: AutoScale.
Some explanation about this mode: When the program starts it checks the device's screen dpi. It saves these two values in two variables: screenX and screenY. QVGA screens will return 1 for screenX and screenY. VGA screens will return 2 for screenX and screenY. Other values are also possible. There are another two relevant variables: fixX and fixY. In the regular compilation mode these variables are constants and equal 1. In AutoScale compilation these variables are equal to screenX/Y variables. When a control is created its location and size values will be multiplied with these values. For example: Button1.Width = 70 will be translated to Button1.Width = 70 * fixX. Button1.Left = 20 will be translated to Button1.Height = 20 * fixY. So the result is that the QVGA layout will appear identical on high resolution screens as well. External controls libraries should also deal with the different dpis. Simple solution (this is how ControlsEx.dll deals with it): Mark your library by adding: Code:
C#: public static object B4P_AutoScale = null; VB .Net: Public Shared B4P_AutoScale As Object For more complex libraries that need to deal with the different values you can access these 4 values with: Code:
double scaleX = (double)(Thread.GetData(Thread.GetNamedDataSlot("scaleX")));
double scaleY = (double)(Thread.GetData(Thread.GetNamedDataSlot("scaleY")));
double fixX = (double)(Thread.GetData(Thread.GetNamedDataSlot("fixX")));
double fixY = (double)(Thread.GetData(Thread.GetNamedDataSlot("fixY")));
Code:
double scaleX = (double)(Thread.GetData(Thread.GetNamedDataSlot("scaleX")));
double scaleY = (double)(Thread.GetData(Thread.GetNamedDataSlot("scaleY")));
il.ImageSize = new Size((int)(il.ImageSize.Width * scaleX), (int)(il.ImageSize.Height * scaleY));
__________________
Basic4ppc reference list |
|
|||
|
Hi Erel
One suggestion. Basic4ppc to work with different screen sizes The application may perform the calculation of the values of screenx and screeny as follows: screenx = form1.width/240 screenY = form1.Height/320 -google traductor- |
|
||||
|
I can confirm that AutoSize compilation works also for 480*800 sceens with following restriction:
- ScreenScale = 2 for both sizes 480*640 and 480*800 Then it depends on what you want to do: - do you want to stretch vertically the controls, in that case ScreenScale should be equal to 2.5 ? - do you want to make profit of the supplementary surface of the screen ? At the moment I am programming for my htc Touch HD and set the screen height in the FormDesigner to 400, this works well. Best regards.
__________________
Klaus Switzerland |
|
||||
|
Hi manu,
To program for the 480*800 screen size you have 2 options. In the FormDesigner: - set the screen size to 240*400 and compile with AutoSize advantage: the screen on the desktop looks similar to what you will se on the PPC disadvantage: the images in controls are stretched - set the screen size to 480*800 and compile with Device Exe advantage: you take full advantage of the screen resolution and pixel size disadvatage: on the desktop the screen looks somewhat different than on the PPC, the size is big but the font size in controls remains small. If, in the program, you draw onto the device you take advatage of the screen resolution in both cases. Both options work. Best regards.
__________________
Klaus Switzerland |
|
||||
|
Quote:
In all other cases you will need to use FixX/Y and ScaleX/Y.
__________________
Basic4ppc reference list |
|
||||
I got HTMLPanel working with AutoScale and because it relies heavily entirely on pixel level working if I can get that working I can get anything working!However as the Basic4ppc Form drawing functions are AutoScale aware how much should ImageLib and ImageLibEx also be made AutoScale aware? I note that ImageLib is partially aware in that the Drawer.Refresh methods use fixX/Y but none of the other Drawer methods or other ImageLib objects do. This seems a bit odd as if a Rectangle, say, is drawn under AutoScale on a VGA device and Refresh called on the same Rectangle it will invalidate an area four times that required! To use ImageLib as it presently stands a program, even when AutoScaled, needs to compensate for ScreenScaleX/Y itself when drawing so why not also Refresh ![]()
__________________
Sorry, but I don't answer questions by PM or email. Please post your queries in the forum. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| questions about testing in run mode | hlo | Questions & Help Needed | 4 | 03-30-2009 11:20 PM |
| Ringer volume and vibrate mode | ikaplan | Questions & Help Needed | 1 | 08-27-2008 04:45 AM |
| SD-Card in sleep mode | berndgoedecke | Questions & Help Needed | 0 | 07-17-2008 06:02 PM |
| FTP passive mode | vinians | Questions & Help Needed | 0 | 08-31-2007 01:43 PM |
| debug mode stuck.. | belotrei | Bug Reports | 2 | 06-05-2007 04:17 PM |