?
Solved

Convet PNG file to SVG file?

Posted on 2013-10-30
14
Medium Priority
?
1,411 Views
Last Modified: 2013-11-06
Visual Studio 2012 - C# - Winforms

Does anyone know how to convert a png file to a sgv file?

Or are there any third party controls that can do this?

Thanks
0
Comment
Question by:NDennisV
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
14 Comments
 
LVL 15

Expert Comment

by:Ess Kay
ID: 39611840
You can call the command-line version of incscape to do this:

http://harriyott.com/2008/05/converting-svg-images-to-png-in-c.aspx

Also there is a C# SVG rendering engine, primarily designed to allow SVG files to be used on the web on codeplex that might suit your needs if that is your problem:

Original Project
http://www.codeplex.com/svg

Fork with fixes and more activity: (added 7/2013)
https://github.com/vvvv/SVG
0
 

Author Comment

by:NDennisV
ID: 39611962
I need it the other way around - Plenty of ways to turn SVG's into PNG's but not turn PNG's into SVG's.
0
 
LVL 15

Expert Comment

by:Ess Kay
ID: 39612192
Check out the SVG framework in C# and an SVG-GDI+ bridge project.

From the above web page...

The SvgGdi bridge is a set of classes that use SvgNet to translate between SVG and GDI+. What this means is that any code that uses GDI+ to draw graphics can easily output SVG as well, simply by plugging in the SvgGraphics object. This object is exactly the same as a regular .NET Graphics object, but creates an SVG tree. Even things like hatched fills and line anchors are implemented.





Source: stackoverflow.com/questions/1525421/drawing-svg-in-net-c
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:NDennisV
ID: 39612611
Thank you - I will check it out tomorrow
0
 

Author Comment

by:NDennisV
ID: 39616336
stackoverflow.com/questions/1525421/drawing-svg-in-net-c

leads me to https://github.com/vvvv/SVG

which led me to http://www.oss-marketplace.com/index.php/downloads-mainmenu-63/Inkscape/Entwicklerversionen/

Where I downloaded the source code but it is all about rendering on the web and not Winforms.
0
 
LVL 15

Expert Comment

by:Ess Kay
ID: 39616840
no, the codeproject link on top of the comment Titled: "SVG framework in C# and an SVG-GDI+ bridge project."
0
 

Author Comment

by:NDennisV
ID: 39616898
The project is from 2003 which concerns me.

I downloaded the source and the demo project and a library is missing: AxSVGACTIVEXLib so it will not run.

Reading the help I do not see anything about converting from a PNG to a SVG. It's all about SVG only.

Thanks
0
 
LVL 15

Expert Comment

by:Ess Kay
ID: 39616946
from what I see, you can use a png instead of BMP supplied with the test project

as for the missing file, it may be in the project's original website

www.riskcare.net/SvgNet
I can't access it from my network to confirm
0
 

Author Comment

by:NDennisV
ID: 39616986
www.riskcare.net/SvgNet is no longer a valid web site.

I found the library on a Chinese site but I don't know if I should trust it.

I do not see anything about converting bmp to SVG's. The only thing I can find are Icon files that are converted to bmp's.

Thanks
0
 
LVL 15

Expert Comment

by:Ess Kay
ID: 39617000
if its just a library, it cant harm you if you run Windows Vista or newer.



if it tries to change system files, you will get the 'Do you want to continue' message
0
 

Author Comment

by:NDennisV
ID: 39617011
Yes, but I do not see where it converts anything to SVG's except perhaps an Icon file.
0
 
LVL 15

Accepted Solution

by:
Ess Kay earned 1500 total points
ID: 39617019
sorry bud, look like the internet does not offer a solution.


Here is a project used for the web, perhaps you can recycle code for a winform

https://github.com/vvvv/SVG
0
 
LVL 15

Expert Comment

by:Ess Kay
ID: 39617028
SVG files are vector graphic files, PNG files are raster files. I would say that there is no easy way to automatically convert on to another in C# or another language.


Alternatively you can check the list here of softwares which run the conversions
perhaps you can find a dll in one of them to use
 https://en.wikipedia.org/wiki/Comparison_of_raster_to_vector_conversion_software
0
 

Author Comment

by:NDennisV
ID: 39628409
I've looked at all the links on Wikipedia and cannot find anything.
0

Featured Post

Basic Security of Your VPC

So, you’ve got this shiny new VPC and a fancy new application configured on your EC2 servers ready to go. This application is only accessible from your computer, which is great for security, but you need your users to be able to access it! So, what’s the easiest way to do this?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question