Download the free trial version
Basic4android Video
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 compilation mode and external libraries

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 04-29-2009, 05:17 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

This code is taken from the optimized compiled form's code (CEnhancedForm.cs) :
Code:
bitmap = new Bitmap((int)(ClientSize.Width / b4p.fixX), (int)(ClientSize.Height / b4p.fixY));
As you can see from it, the bitmap which is the drawing layer of the form is smaller than the complete form.
When the bitmap is painted on the form it is stretched to the form's size.
So all the drawings which are done on this bitmap shouldn't be scaled.
Refresh methods are scaled as these methods affect the form and not the bitmap.
__________________
Basic4android documentation
Reply With Quote
  #12 (permalink)  
Old 04-29-2009, 05:26 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

I'm afraid that's not what I meant. I looked at what Form.cs does and that was why I said "Basic4ppc Form drawing functions are AutoScale aware". It's ImageLib I'm referring to which is not AutoScale aware apart from Refresh, which is odd as I pointed out.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #13 (permalink)  
Old 04-29-2009, 05:38 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Try the attached program.
__________________
Basic4android documentation
Reply With Quote
  #14 (permalink)  
Old 04-29-2009, 06:25 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Sorry, I'm not making myself very clear . Forget about my references to Refresh, I forgot that in ImageLib it only works on Forms and Refresh isn't really relevant to what I am trying to say. What I was really thinking about is using ImageLib to draw on a Bitmap associated with, say an Image Control in an AutoScaled app running on a VGA screen. The Image Control size will be AutoScaled, however a Bitmap (which doesn't AutoScale)created with New2(ImgCtl.Width, ImgCtl.Height) will no longer to match it and anything drawn on the Bitmap using ImageLib Drawer methods is also not rescaled. However with further investigation I see that you have fiddled the Image Paint method to do the same expansion as Form.Paint does. I hadn't thought of that and so now I've answered my own question anyway! You've obviously put a lot of thought into this .

On a different topic I've noticed that Listview checkboxes and possibly Treeview (I haven't tried it) checkboxes and expansion plus signs are very small on a VGA screen and I can't immediately see a mechanism to enlarge them. Any ideas?

EDIT:- Found the checkbox sizing thingy! It servos to ImageListSize - that's intuitive (not!).
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.

Last edited by agraham : 04-29-2009 at 06:37 PM.
Reply With Quote
  #15 (permalink)  
Old 04-29-2009, 06:53 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Quote:
You've obviously put a lot of thought into this .
Thanks.

Quote:
EDIT:- Found the checkbox sizing thingy! It servos to ImageListSize - that's intuitive (not!).
Agreed. Took me some time to figure this.
__________________
Basic4android documentation
Reply With Quote
  #16 (permalink)  
Old 04-30-2009, 12:32 PM
Knows the basics
 
Join Date: Aug 2007
Posts: 61
Awards Showcase
Beta Tester 
Total Awards: 1
Default Font Scaling is a real issue for me

Hi,

I tried to do something using the native resolution of a HTC Touch HD (480x800 portrait). See enclosed zip for a quick and dirty example.

Problem: In native resolution the device dpi is not known to the Desktop IDE. This works especially quirky with NumUpDown and Calendar Control, but also for ComboBox.

So, what would be required for me are the following fixes:

1. A Desktop Designer option to chose a target resolution, so that desktop design corresponds to the device w.r.t. to (relative) font sizes and control sizes (heights).

2. The possibility to set font/sizes and/or Control heights in all controls.

Best regards.
Jens
__________________
Unclutter your code -- use an obfuscator
Reply With Quote
  #17 (permalink)  
Old 04-30-2009, 12:46 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Try to set the screen size (on the desktop) to 240x400 and compile with AutoScale.
__________________
Basic4android documentation
Reply With Quote
  #18 (permalink)  
Old 04-30-2009, 01:07 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Your Screen03 looks wrong. The form looks too large. If you want AutoScaling to work then you need to layout on a form sized 240 x 400 in the IDE and it will then look OK when compiled AutoScaled on your 480 x 800 device.

You can see that in Screen02, native mode, your controls are over halfway across the screen, that is why some are off screen when AutoScaling doubles their co-ordinates and sizes.

I agree that font size is a problem if you want to layout in the IDE at the native resolution of your device. This is because fonts are specified in points which is an actual dimension on the screen whereas everything else is specified in pixels. So fonts are drawn the same size whatever the dpi of the screen whereas everything else scales. If you double the font size in the controls while laying out a native app in the IDE you will get a reasonable idea of what things will look like. You could also lay out a form in a project in the device VGA IDE and then bring it back to the desktop to add the code.

Quote:
2. The possibility to set font/sizes and/or Control heights in all controls
I don't understand this I'm afraid. Which controls don't already allow this?
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #19 (permalink)  
Old 04-30-2009, 01:38 PM
Knows the basics
 
Join Date: Aug 2007
Posts: 61
Awards Showcase
Beta Tester 
Total Awards: 1
Default Workarounds...

Quote:
Originally Posted by agraham View Post
Your Screen03 looks wrong. The form looks too large. If you want AutoScaling to work then you need to layout on a form sized 240 x 400 in the IDE and it will then look OK when compiled AutoScaled on your 480 x 800 device.
Actually, i DON'T want to use AutoScale but to develop for the true native 480x800. Which is not well supported by the Desktop IDE. Using 240x400 and AutoScale is a workaround but not a solution.

Quote:
Originally Posted by agraham View Post
I agree that font size is a problem if you want to layout in the IDE at the native resolution of your device. This is because fonts are specified in points which is an actual dimension on the screen whereas everything else is specified in pixels. So fonts are drawn the same size whatever the dpi of the screen whereas everything else scales. If you double the font size in the controls while laying out a native app in the IDE you will get a reasonable idea of what things will look like. You could also lay out a form in a project in the device VGA IDE and then bring it back to the desktop to add the code.
Again, working on the device is a workaround, albeit a valid one.

Quote:
Originally Posted by agraham View Post
I don't understand this I'm afraid. Which controls don't already allow this?
The said NupUpDown and Calendar controls for example. Maybe others, to. And NupUpDown does not allow to set your own font size. And Trees do not allow to set a font size, too.
__________________
Unclutter your code -- use an obfuscator
Reply With Quote
  #20 (permalink)  
Old 04-30-2009, 02:10 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

I'm not sure what type of application you are building but in most cases AutoScale should give similar results to using the true native resolution.
Anyway the UI should not be too small or too cluttered.
Auto scaled forms also use significantly less memory which can be important if you have many forms.
__________________
Basic4android documentation
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
questions about testing in run mode hlo Questions (Windows Mobile) 4 03-31-2009 12:20 AM
Ringer volume and vibrate mode ikaplan Questions (Windows Mobile) 1 08-27-2008 05:45 AM
SD-Card in sleep mode berndgoedecke Questions (Windows Mobile) 0 07-17-2008 07:02 PM
FTP passive mode vinians Questions (Windows Mobile) 0 08-31-2007 02:43 PM
debug mode stuck.. belotrei Bug Reports 2 06-05-2007 05:17 PM


All times are GMT. The time now is 05:06 AM.


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