Svg to png conversion
Hey Guys, I made a code in windows forms (C#) where I looked for all the svgs and I wanted them all to be converted to .png in a folder and i found imageMagick.Net, but I can´t find a way to convert the pictures with the .net version.. how can I do that?
13 Replies
https://github.com/svg-net/SVG
could give this library a try
GitHub
GitHub - svg-net/SVG: Fork of the ms svg library
Fork of the ms svg library. Contribute to svg-net/SVG development by creating an account on GitHub.
How can I make a code for my topic with this library? Seems interesting
Can u pls. specify how to convert a png to svg with this library?
https://github.com/svg-net/SVG/blob/master/Samples/SvgConsole/Program.cs is a sample from svg to png
GitHub
SVG/Samples/SvgConsole/Program.cs at master · svg-net/SVG
Fork of the ms svg library. Contribute to svg-net/SVG development by creating an account on GitHub.
but png to svg doesn't make much sense
no what I meant was svg to png lol
i said it wrong XD
sorry
thanks man, I will look into this after work! if I have questions I will ask them later!
I looked into it and I wonder how to get the width and the height from the file when I don´t know both?
svg is a vector format, you can scale it how you want
But if a file has different height and length it wouldn´t make sense to give the picture the same length and height
is there a way to read it out the svg file?
hello
the SvgDocument have both width and height properties. if you want to scale it to a certain heigth/wodth and keep the ratio you can use SvgDocument.RasterizeDimensions to help calculate the other value
I can´t seem to find a way converting svg to png, is there a very easy way only with the things C# has included with Windows Forms?
also: why is it so hard to convert svg to png?
There must be a way to convert svg to png when I have a base63 string of the svg, or a file, but with the documentation I can´t make a real png file, maybe just the base 64 string I don´t know. If someone knows how to make a file pls. tell me thx.
Stack Overflow
Converting SVG to PNG using C#
I've been trying to convert SVG images to PNG using C#, without having to write too much code. Can anyone recommend a library or example code for doing this?
There is one mayor issue with this code - it doesn´t function with the byte array but I can use it to make the code right, i will look into this. I might use the filename for the stream including its directory
guys it worked - thanks so much for the help - you don´t know how I appreciate it!!! 🙂
i will sign this post as finished if that is possible
I think I can´t do it, pls. mark the post as finished, thanks again!
$close
If you have no further questions, please use /close to mark the forum thread as answered