×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Feb 2005
    Location
    Kista, Sweden
    Posts
    267

    Can't display SVG images

    I want to display a SVG image with "Scalable 2D Vector Graphics API". I have created the image by converting a JPG image into SVG. I use it as an icon for a Symbian C++ app and it gets shown there. But I get this error when I try to display the image in a midlet:

    org.w3c.dom.DOMException: error.invalid.trait.value([0] fill-rule, [1] nonzero;clip-rule:nonzero;stroke:#000000;stroke-miterlimit:4;, [2] g(Ebene_x0020_1), [3] http://www.w3.org/2000/svg)

    I try do display other SVG images that I found on the webb. This results in no error, but no image is ever shown. What do I have to do to get the SVG images to be shown? This my code:

    init method:

    sg = ScalableGraphics.createInstance();
    sg.setRenderingQuality(sg.RENDERING_QUALITY_HIGH);
    try {
    InputStream svgStream =
    getClass().getResourceAsStream("tiger.svg");
    svgImage = (SVGImage) (SVGImage.createImage(svgStream, null));
    svgImage.setViewportWidth(100);
    svgImage.setViewportHeight(100);

    paint method:

    sg.bindTarget(g);
    sg.setTransparency(1f);
    sg.render(0, 0, svgImage);
    sg.releaseTarget();

  2. #2
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Can't display SVG images

    the error seems to indicate that your SVG uses properties that are not supported.

  3. #3
    Regular Contributor
    Join Date
    Feb 2005
    Location
    Kista, Sweden
    Posts
    267

    Re: Can't display SVG images

    I see. I converted JPG images to SVG with

    http://www.enetzwerk.de/svg/index2.html

    Do you know a better way of converting SVG images?

  4. #4
    Regular Contributor
    Join Date
    Feb 2005
    Location
    Kista, Sweden
    Posts
    267

    Re: Can't display SVG images

    How can I make a SVG image with properties that are supported? Are there special rules for making SVG images, so that they should work in "Scalable 2D Vector Graphics API"? I try to display standard SVG images that I found online, but I get this error message:



    org.w3c.dom.DOMException: error.invalid.trait.value([0] fill, [1] #ffffff; stroke:#000000; stroke-width:0.172, [2] g(null), [3] http://www.w3.org/2000/svg)
    at com.sun.perseus.model.ElementNode.illegalTraitValue(), bci=70
    at com.sun.perseus.model.ElementNode.parsePaintTrait(), bci=94
    at com.sun.perseus.model.CompositeGraphicsNode.setTraitImpl(), bci=842
    at com.sun.perseus.model.StructureNode.setTraitImpl(), bci=560
    at com.sun.perseus.model.Group.setTraitImpl(), bci=152

Similar Threads

  1. svg as background,can't display in 3250
    By yyyly in forum Symbian
    Replies: 5
    Last Post: 2007-11-20, 04:42
  2. svg as background,can't display in 3250
    By yyyly in forum Symbian User Interface
    Replies: 3
    Last Post: 2007-11-13, 05:44
  3. SVG icon can't display in Listbox on 3rd
    By iamphilip in forum Symbian User Interface
    Replies: 3
    Last Post: 2007-04-30, 04:29
  4. Can't display an Images on S60 emulator without Symbiam
    By elimche in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2003-05-13, 13:29

Posting Permissions

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