Skip to main content

J2ME Insert images onto a svg background ?

3 replies [Last post]
nevermindrider
Offline
Joined: 2009-05-06
Points: 0

Hi!

What I am trying to do is to load images (png) dynamically onto a screen that is build with SVG.

I am using NetBeans VisualMidlet Designer.

I have created an SVG file, and declared some text with the ID menuItem_X. Then I added an SVG-Menu and put my svg. File into it. The menu items show up and i can assign commands to them. so far so good.

look here if u want to see a similiar menu screen: http://www.netbeans.org/kb/55/svg-tutorial.html

One menu item is e.g. Shop 1. Now when Shop 1 is opened a screen should show up with the same background that my svg file provides for the menu, but additionally the Shop-Logo should be loaded onto that screen.

That should happen dynamically, so i dont want to create another svg-file where the logo is already placed, and link that to the menu-item.

I would very appreciate your help!

Thanks in advance,
Patrick

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
terrencebarr
Offline
Joined: 2004-03-04
Points: 0

I'll take a stab at answering without waiting for your clarification:

If you have built the UI with NetBeans SVG components you need to check whether these components allow you to dynamically add images. You could check the NetBeans mobility mailing lists for that: http://mobility.netbeans.org/servlets/ProjectMailingListList

In general, though, JSR 226 allows you to dynamically add nodes to the SVG DOM tree. The SVG engine will recognize changes and re-render the screen as necessary. So you could have the logo as an SVG image and dynamically add that to the DOM tree whenever/wherever you need it.

You can read up on more SVG and JSR 226 information here:

https://meapplicationdevelopers.dev.java.net/phoneme_ui_labs.html

or in this Mobility Tech Tip:

http://developers.sun.com/mobility/midp/articles/s2dvg/index.html

Hope this helps,

-- Terrence

nevermindrider
Offline
Joined: 2009-05-06
Points: 0

Hi!

Was very busy the last few days, too. Thanks for your answer so far!

Would like to clarify my problem:

I want to create a menu (SVG_Menu, items have the tag) and each menuItem (shop name e.g. pizzahut) in that menu should refer to another SVG_screen (pizzahutshow screen) where detailed Information about the shop are displayed (name, adress, phone, etc.).

All that works fine. But I'd like to implement a counter (integer) for each shop (how many pizzas have i bought there) and depending on that intager i'd like to shop images (pizza slices as jpg, png, svg or whatever, format doesn't matter to me) on that shop screen.

So, e.g. the pizzahut integer counter = 3, so on the pizzahut screen show up 3 times the same image, but somehow integrated (overlay, ...) on my show display.

Couldnt find the appropriate information on the pages you provided.

Thanks very much for your further assistance!

Cheers

Patrick

terrencebarr
Offline
Joined: 2004-03-04
Points: 0

Sorry for the slow reply. It sounds like you want to overlay the opaque the shop logo image over the background image for that second screen, correct?

-- Terrence