This is a discussion on Auto Resize Applications in J2ME ? within the J2ME forums, part of the Mobile Software Development category; Auto Resize Applications in J2ME ?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| When you have programmed your midlet for perfect fitting of your test device screen resolution, for instance 176x208, and now you want to make the application adapt automatically for other screen sizes, you can do that with out making much of a change in the Midlet. First of all you need to declare two public variables accessible through out the midlet. At the load of the midlet, get the getWidth and getHeight values of Display object. scrnW=getWidth(); scrnH=getHeight(); hfactor=scrnW/176f; vfactor=scrnH/208f; Now multiply these factors with each hard coded values you have set for vertical and horizontal components of your drawing code. Make sure that you add the “f” after your constants for floating point accuracy |
| |||
| hi there, there is a class provided in motorola sdk com.motorola.extensions.ScalableJPGImage in which you can scale jpg images to fit correctly in you application needs.. not only for jpg images but for png too... ScalableJPGImage sImage = ScalableJPGImage.createImage( "/test.jpg", 10, 10); where test.jpg is the image in resource folder.. in this example i have set the image size 10 for width and height respectively it can modified to screen size using GETheight() and getwidth() property
__________________ cheers Aman |
| |||
| ya.. this scalableimage class can be used only in motorola phones since coz this optional package scalableImageEnhancement 1.0 is provided by only motorola and no other manufacturing companies like nokia, sony ericsson provide functionality for scaling images....
__________________ cheers Aman |
| |||
| HI aman what are the scalable image funtionalities provided by nokia, sonyericsson manufacturers..is it possiable can u explain some more
__________________ thanx n regards jeyaprakash.c |
| |||
| As far as i know there is no manufactures except motorola provides scalableimage functionalities...may be nokia or sony ericsson provide this type of functionality in future api....
__________________ cheers Aman |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| can i make auto login? | saravanan | Operating Systems | 0 | 03-21-2008 04:33 AM |
| How to resize a visitor's browser? | jeyaprakash.c | HTML, CSS and Javascript Coding Techniques | 4 | 10-14-2007 09:20 PM |
| Stage and Background resize but other objects not to resize | aramesh | Flash Actionscript Programming | 1 | 08-22-2007 10:33 PM |
| Explain Connecting External Hardware to J2ME applications | itbarota | J2ME | 2 | 08-06-2007 08:11 AM |
| Auto Update Copyright [PHP] | sanray316 | PHP Programming | 1 | 03-25-2007 12:26 PM |