×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2007
    Location
    Germany
    Posts
    2

    Question jsr 226 - Emulators ignore viewbox attribute ?!

    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

  2. #2
    Registered User
    Join Date
    Jul 2007
    Posts
    1

    Re: jsr 226 - Emulators ignore viewbox attribute ?!

    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...

Similar Threads

  1. JSR 226 RI setTraintNS() bug?
    By jessicay in forum Mobile Java General
    Replies: 3
    Last Post: 2008-12-02, 19:12
  2. JSR 226 compatible implementation for J2SE
    By The.French.DJ in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2007-02-19, 20:25
  3. Replies: 4
    Last Post: 2006-09-05, 15:15
  4. JSR 226 and lag
    By gutmand in forum Mobile Java General
    Replies: 6
    Last Post: 2006-08-30, 09:09
  5. Jsr 226 Ri
    By Nit1507 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-08-17, 13:50

Posting Permissions

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