Results 1 to 7 of 7

Thread: using svg images on windows mobile

  1. #1
    Junior Member
    Join Date
    Apr 2008
    Posts
    4

    using svg images on windows mobile

    Hi.
    I am trying for 2 days now to understand how to manipulate openvg to handle svg images on windows mobile.
    Im creating a location based app and i need svg basically for maps, street names etc.
    I read that openvg is suitable for me - am i write ?

    So please, can you tell me how to use it to load an image or reffer me to an example ?
    The only examples that i see are not loading phisical image, but reading some code from an array.

    Thanks.

  2. #2
    Senior Member
    Join Date
    Feb 2006
    Posts
    115
    By physical image, I imagine you mean things like .jpg, .png, .bmp, etc?

    OpenVG deals with decompressed pixel data. The above files are compressed, have image headers, comments, etc. You will need an image library for converting these various file formats into uncompressed pixel data. Then you will be able to use vgImageSubData() normally.

    The other possibility it to use some program like gimp, to convert your files into a C source files which define the uncompressed pixel data, and include those in your program.

  3. #3
    Junior Member
    Join Date
    Apr 2008
    Posts
    4

    Reply

    Hi and thanks for your reply.
    No, i ment image like tiger.svg. this is an image in an svg format, am i wrong ?

    i will check the info you told me about gimp to convert the data to a c file. i always see image data on examples that is in fact a c code that contains an array of values - i guess that's what gimp does ?
    there isnt any other way to load direct an *.svg image ?

    thanks.

  4. #4
    Senior Member
    Join Date
    Feb 2006
    Posts
    115

    Re: Reply

    Quote Originally Posted by Mrgoos
    Hi and thanks for your reply.
    No, i ment image like tiger.svg. this is an image in an svg format, am i wrong ?

    i will check the info you told me about gimp to convert the data to a c file. i always see image data on examples that is in fact a c code that contains an array of values - i guess that's what gimp does ?
    there isnt any other way to load direct an *.svg image ?

    thanks.
    SVG is an XML description of the shapes and stuff that should be rendered. OpenVG is an API that does rendering (like OpenGL or DirectX). There is no mechanism in OpenVG to parse the SVG's XML input, and turn it into compiled binary code which uses the OpenVG API to render. OpenVG has the feature set to allow someone to implement an SVG viewer with it, but OpenVG itself will not render SVG files.

    In short, if you want to display SVG files directly, you will need to write (or find) a program to do do the conversion for you (the full SVG spec is a bit complicated though, so it woud end up being a fair amount of work). I don't know of any public programs to do this conversion for you though.

    My suggestion to use gimp was in the event you were trying to display picture/image files like *.jpg with the VGImage type. Gimp could help you there, but it wont help you on *.svg files.

    Depending on your application, you may wish to use some tool to convert the svg file to bitmap file.

  5. #5
    Junior Member
    Join Date
    Apr 2008
    Posts
    4

    OK thanks,

    but it is very problematic. it means that anytime when i add a new image to my project i need to compile it instead of just add a resource image (*.svg) to the server and than manipulate it.
    even if i want to change an image on the same name i need to compile it since it's code changes.

    Thanks.

  6. #6
    Senior Member
    Join Date
    Feb 2006
    Posts
    115

    Re: OK thanks,

    Quote Originally Posted by Mrgoos
    but it is very problematic. it means that anytime when i add a new image to my project i need to compile it instead of just add a resource image (*.svg) to the server and than manipulate it.
    even if i want to change an image on the same name i need to compile it since it's code changes.

    Thanks.
    OpenVG is a rendering API. It basically a set of functions which you can say "draw me an arrow of this type over there" through a set of librbary calls. e.g. In a C source file, the line:
    Code :
    vgDrawPath(pth, VG_FILL_PATH);

    SVG is a description file of what should be drawn how and where in XML (something similar to what HTML looks like). e.g.:
    Code :
    <p= "M 10 10 L 20 20 L 20 10 z">

    You need a program to convert the XML description into the correct API calls with the correct parameters.

    If you're trying to hardcode the displaying of a particular svg file, you may as well convert the XML data directly into something OpenVG can render and render it directly through OpenVG.

    If you need to display any arbitrary SVG file, you need a program that parses the XML file and and renders it using OpenVG. An SVG viewer is possible to be written using OpenVG as it supports the necessary functions to implement all functionality (with creative use of pbuffers and alphamasks to support more advanced features like clipping and group opacity), but SVG is rather a complicated standard. You are probably looking at several months of development time to write your own implementation. As I said - I am not aware of any publically available source that does this SVG -> VG conversion (that doesn't mean it doesn't exist though - do a search for it).

  7. #7
    Junior Member
    Join Date
    Apr 2008
    Posts
    4

    Thanks again

    Mrgoos.

Similar Threads

  1. openGL ES 2.0 on windows mobile 6
    By zzzx3 in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 04-16-2009, 05:13 AM
  2. Opengl es and windows Mobile 6.0
    By Eymerich in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 03-09-2008, 06:18 AM

Posting Permissions

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