05-17-2010 05:50 AM
I have a quick and probably very dumb question regarding the positioning of a bitmap as background in a screen. The relevant piece of code is the following:
And for some reason, Eclipse tells me that the three last parameters are incorrect (expecting int). What is the syntax then? I am using JDE 5.0.
Any kind of help would be appreciated, thanks!
05-17-2010 07:11 AM
I'm a newbie myself but a quick search using the community search option and using the phrase "set image as background" gives this as the first result:
The article is a Knowledge Base article and is probably what you are looking for.
05-17-2010 07:51 AM
I think u can go ahead like this:
create a vertical field maanger and place the image in the paint method
VerticalFieldManager vfm = new VerticalFieldManager()
final Bitmap background = Bitmap.getBitmapResource("back.png")
protected void paint(Graphics g)
int y = this.getVerticalScroll;
protected void sublayout(int width,int height)
//here u can set the position of other elements that belongs to this manager
05-18-2010 06:10 AM - edited 05-18-2010 06:13 AM
Thanks for the reply, however this would not center both verticaly and horizontaly the image, would it?
I have read the knowledge base article of course, it is just that I don't know how to use the following function for example:
Background bg = BackgroundFactory.createBitmapBackground(Bitmap bitmap, int positionX, int positionY, int repeat);
given the following possible arguments: