×

Discussion Board

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

    How to make a SVG image for Scalable 2D Vector Graphics API?

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

    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
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: How to make a SVG image for Scalable 2D Vector Graphics API?

    Don't quote me, but I think they need to be SVG-T. I think there is a tool in the Series 60 SDK called SVG2SVGT. Search the wiki, you should find some references to it.

    Graham.

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

    Re: How to make a SVG image for Scalable 2D Vector Graphics API?

    Thanks, I finally got it to work and I can see the SVG image! I used "SVG pony" to convert the SVG images.

    I want to scale them in both horisontal and vertical direction, with different scale factors for these directions. There is however just one scale method in the "Scalable 2D Vector Graphics API". This method only has one argument and only allows the same scaling in X and Y direction. I want to
    scale with another value in Y than X direction. Isn't this possible with "Scalable 2D Vector Graphics API"?

Similar Threads

  1. Help! Is this a bug in Scalable 2D Vector Graphics API (JSR-226) ?
    By the_mincer in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2009-09-02, 23:31
  2. Replies: 4
    Last Post: 2008-05-14, 21:54
  3. simple 2D vector graphics library in symbian?
    By halcyonmd in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2005-10-03, 04:22
  4. Support for Scalable Vector Graphics
    By anba1548 in forum General Development Questions
    Replies: 1
    Last Post: 2004-08-05, 10:23
  5. Nokia & Scalable Vector Graphics
    By anba1548 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2004-08-03, 21:19

Posting Permissions

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