Skip to main content

How to display a BackgroundImage

1 reply [Last post]
bjoern_minkmar
Offline
Joined: 2007-06-11
Points: 0

Hi Bill,

I am having difficulties with what should be a simple task:

Instead of a videoloop i want to display a still image in the background of my application.
I've tried the following:

startXlet() {
scene.setBackgroundMode(HScene.IMAGE_CENTER);
// Image backgroundImg is loaded via MediaTracker
scene.setBackgroundImage(backgroundImg);
...
}

But the application won't start in the emulator.
Currently there is no player object in the application and the image is a JPEG.
Would be really great if you could tell me how to achieve the goal.

Many thanks in advance,
Björn

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Bill Foote

Well, first, please don't think that I'm the only one
on this forum. Questions shouldn't be addressed to me,
they should be to the forum!

That said, have you looked at HBackgroundImage?
I haven't looked into HScene.setBackgroundImage, but
HBackgroundImage would be the place I'd look for setting
a background image.

Bill

bd-j-dev@mobileandembedded.org wrote:
> Hi Bill,
>
> I am having difficulties with what should be a simple task:
>
> Instead of a videoloop i want to display a still image in the background of my application.
> I've tried the following:
>
> startXlet() {
> scene.setBackgroundMode(HScene.IMAGE_CENTER);
> // Image backgroundImg is loaded via MediaTracker
> scene.setBackgroundImage(backgroundImg);
> ...
> }
>
> But the application won't start in the emulator.
> Currently there is no player object in the application and the image is a JPEG.
> Would be really great if you could tell me how to achieve the goal.
>
> Many thanks in advance,
> Björn
> [Message sent by forum member 'bjoern_minkmar' (bjoern_minkmar)]
>
> http://forums.java.net/jive/thread.jspa?messageID=221446
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net