You Are Here:

Community: Developer Discussion Boards

#1 Old Question jsr 226 - Emulators ignore viewbox attribute ?! - 2007-04-11, 13:41

Join Date: Apr 2007
Posts: 2
Location: Germany
quarus
Offline
Registered User
Hi there !

I am developing a J2ME MIDlet using JSR 226. By using the following <svg> tag the SVG image is stretched and scaled to fill the entire Canvas.

<svg version="1.1"
baseProfile="tiny"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
id="svg-root"
preserveAspectRatio="none"
width="200.0" height="150.0" viewBox="0 0 200.0 150.0">


By setting the SVG width and height attributes and the width and height of the viewBox to the same values, the SVG image is always scaled to match different device screen sizes (Of course the ViewPort parameters of the SVGImage are set fill out the whole canvas in my MIDlet). This method works fine with the Sun WTK, however it fails with the Nokia S60 MIDP emulator: Instead of scaling the image to fit the screen, only a part of the image is visible. After testing a bit, it seems to me like as if the viewBox attribute of the <svg> tag is completely ignored by the Nokia S40 & S60 emulators. Any suggestions or hints?

P.S:
I can't test the MIDlet on a real device yet:(
Reply With Quote

#2 Old Re: jsr 226 - Emulators ignore viewbox attribute ?! - 2007-08-20, 14:02

Join Date: Jul 2007
Posts: 1
SilentBob470
Offline
Registered User
Hi,

I've got the same Problem.
I think the problem is the width and height spezified in the rootElement of the SVGImage. It is obviously set to 100x100 when a new SVGImage is created.

I tried:

rootElement.setFloatTrait("width",200.0f);
rootElement.setFloatTrait("height",200.0f);

the Traits are altered (tested with rootElement.getFloatTrait("width")...), but the outcome is the same as before, without any ErrorMessage...

If I test it with altered "width" and "height" on my device (Nokia 6131) I get "trait not supported on this element". Therefore it is no EmulatorBug...
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
JSR 226 RI setTraintNS() bug? jessicay Mobile Java General 3 2008-12-02 20:12
JSR 226 compatible implementation for J2SE The.French.DJ Mobile Java Tools & SDKs 1 2007-02-19 21:25
Problem with service attribute propagation and service attribute retrieval pfrey Bluetooth Technology 4 2006-09-05 16:15
JSR 226 and lag gutmand Mobile Java General 6 2006-08-30 10:09
Jsr 226 Ri Nit1507 Mobile Java Media (Graphics & Sounds) 0 2005-08-17 14:50

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia