Getting path/SVG support in a VS Project

From Visual Basic to GNU C, this is the place to talk programming.

Moderators: SecretSquirrel, just brew it!

Getting path/SVG support in a VS Project

Postposted on Sun Dec 19, 2010 8:37 am

So here's the idea - I take the single line from a SVG file that describes the curve, paste it into a textfield in my program, and then the program draws the path on the screen and controls a human to move his hand along the path.

Problem is, I don't want to rewrite the code to parse the SVG line. First, I'm duplicating work that's been done already, and second, I could introduce bugs. So what do I do? I think including librsvg is good, but librsvg is... well, it depends on so many other libraries it's not even funny. The program that I'm working on has enough dependencies to begin with, AND it's a Visual Studio 2003 Project, so I'm not even sure about how to include those libraries(see my other thread on the issue, I gave up because I was toying with the idea of creating an intermediate fileformat). Is there like a librsvg lite? I just need it to parse a line like

Code: Select all
d="M -5.7142857,-4.7806745 200,152.36218 c 0,0 260,-237.142855 191.42857,102.85715"
Mothership: Thuban 1055T@3.7GHz, 12GB DDR3, M5A99X EVO, GTX470+Icy Vision Rev.2@840/3800, Vertex 2E 60GB
Supply ship: Sargas@2.8GHz, 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Macbook Air Ivy Bridge
Crayon Shin Chan
Minister of Gerbil Affairs
 
Posts: 2251
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia

Re: Getting path/SVG support in a VS Project

Postposted on Sun Dec 19, 2010 1:39 pm

According to the site you should just need libxml and libart, shouldn't be that bad? Also, are you doing the rendering yourself? The librsvg seems to do rendering as well? A quick search also seems to suggest some other libraries may exist.
Image
The Model M is not for the faint of heart. You either like them or hate them.

Gerbils unite! Fold for UnitedGerbilNation, team 2630.
Flying Fox
Gerbil God
 
Posts: 24577
Joined: Mon May 24, 2004 2:19 am

Re: Getting path/SVG support in a VS Project

Postposted on Sun Dec 19, 2010 1:56 pm

Look at the libraries at this site:
http://ftp.gnome.org/pub/gnome/binaries ... rsvg/2.22/

They're precompiled for Windows. Look at librsvg-dev_2.22.3-1_win32. They require gdk-pixbuf, which isn't in any of the other zip files that the link provides. GDK imples... it wants GTK too or something, I don't know, but the whole program is already built around Qt 3.3.3! So I really don't want a program that uses GTK and Qt libraries... on Windows.
Mothership: Thuban 1055T@3.7GHz, 12GB DDR3, M5A99X EVO, GTX470+Icy Vision Rev.2@840/3800, Vertex 2E 60GB
Supply ship: Sargas@2.8GHz, 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Macbook Air Ivy Bridge
Crayon Shin Chan
Minister of Gerbil Affairs
 
Posts: 2251
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia


Return to Developer's Den

Who is online

Users browsing this forum: No registered users and 2 guests