×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    34

    Good practice image/logo display guideline

    Hi


    We are having form (not canvas) based application, so that same jar file will run across the device (binary portability).

    when application start/stop, we want to display some logo/image, here are basic query...

    1. only start/stop screen/logo/image should i put canvas based ? (binary portability is must for me, so i can not create multiple jar for multiple device) or should i use form based image/logo ?

    2.Sample code for canvas ?

    3.what should be file size/file type/coloring/pixel size etc should be of logo/image if it is form based (or any sample code/pointer to
    display image across device consistently ?)

    4.what should be file size/file type/coloring/pixel size etc should be of logo/image if it is canvas based (or any sample code/pointer to display image across device consistently ?)

    5. any other good practice related to this.


    Raxit Sheth
    Mobile 4 Mumbai
    raxit(at)m4mum.com

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Good practice image/logo display guideline

    Quote Originally Posted by raxitsheth View Post
    1. only start/stop screen/logo/image should i put canvas based ? (binary portability is must for me, so i can not create multiple jar for multiple device) or should i use form based image/logo ?
    Canvas will look nicer, and there is no fundamental reason not to use one.

    Quote Originally Posted by raxitsheth View Post
    2.Sample code for canvas ?
    Code:
    import javax.microedition.lcdui.*;
    
    public class Splash extends Canvas {
        private int backgroundColor;
        private Image image;
    
        public Splash(Image img, int background) {
            image = img;
            backgroundColor = background;
        }
        
        protected void paint(Graphics g) {
            int width = getWidth();
            int height = getHeight();
            
            g.setColor(backgroundColor);
            g.fillRect(0, 0, width, height);
    
            g.drawImage(image, width / 2, height / 2, Graphics.HCENTER | Graphics.VCENTER);
        }
    }
    Quote Originally Posted by raxitsheth View Post
    3.what should be file size/file type/coloring/pixel size etc should be of logo/image if it is form based (or any sample code/pointer to
    display image across device consistently ?)

    4.what should be file size/file type/coloring/pixel size etc should be of logo/image if it is canvas based (or any sample code/pointer to display image across device consistently ?)
    Use PNG, 8 bit per pixel. Doesn't matter whether you use Canvas or Form. Avoid images that are larger than the screen. File size... that depends on the JAR size limit for the devices you want to support.

    Quote Originally Posted by raxitsheth View Post
    5. any other good practice related to this.
    Remember that images will not stretch to fit the screen. You may need several images of different sizes, depending on what screen sizes you want to support.

    I'd recommend you make a list of devices you want to support.

    Graham.

  3. #3
    Regular Contributor
    Join Date
    Nov 2008
    Posts
    75

    Re: Good practice image/logo display guideline

    Great info, nice code. Thanks.
    Cheers,

    Matt Brenner
    UnME2, Inc.

Similar Threads

  1. How to display data in canvas which is fetched from servlet to midlet.
    By vinoy_george99 in forum Mobile Java General
    Replies: 5
    Last Post: 2009-02-27, 10:11
  2. 5310 Needs Firmware Update To Allow The Display To Stay On!
    By DasFox in forum Series 40 & S60 Platform Feedback Archive
    Replies: 11
    Last Post: 2009-01-13, 11:17
  3. Replies: 2
    Last Post: 2003-08-07, 12:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×