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
Re: Good practice image/logo display guideline
[QUOTE=raxitsheth;684774]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 ? [/QUOTE]
Canvas will look nicer, and there is no fundamental reason not to use one.
[QUOTE=raxitsheth;684774]2.Sample code for canvas ? [/QUOTE]
[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);
}
}
[/code]
[QUOTE=raxitsheth;684774]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 ?)[/QUOTE]
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=raxitsheth;684774]5. any other good practice related to this.[/QUOTE]
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.
Re: Good practice image/logo display guideline
Great info, nice code. Thanks.