Create a Canvas object, add the canvas to your Frame and override the paint() method of your canvas with the one that draws the image. That's all. The paint() method of the Frame is not suitable for this purpose.
An example ImageCanvas (a bit more complicated because it is part of an image button class, supports double buffer, offset etc):
private Image image;
private int horizontalRepaintOffset;
private int verticalRepaintOffset;
private Color bgColor = SystemColor.control;
private boolean doubleBuffered = true; //true is the default value
private Image offscreenImage;
protected int width;
protected int height;
i have done it already but still nothing, i even tried to put a button above and beneth it to see if everything is fine with positioning and still I get a button a blank area and a button. I even made an experiment copied the code to eclipse 3.0 SE environment and compile it and run it - i get an error during execution under eclipse !!! what is wrong i have no idea i run debugger and the picture data isn't null so what is happening ...
as always the path to png file was incorrect for the eclipse SE project i ve done the changes to PP procect in WSDD and nothing blank on Nokia s80 emulator but when i run the application under simple Run application in WSDD everything is oki ??? any ideas??
Try to use gif or jpg images.
Create an image object (make sure the path is correct in pp environment)
Load the image with MediaTracker.
Create an ImageCanvas, pass the Image object to its constructor
add ImageCanvas to your Frame.
Show Frame. That's all. It must work.
Tried everything You have described, and still no results. Everytime i execute an emulator of S80 i do not get the desired picture on my canvas.
Perhaps it is the fault of the environment so i would like You to execute my simple class in Your IDE. Could You do that ??
Or perhaps You send me some similar example to execute.Very simple ofcourse.