[C++ API] Convert svg to png with transparent background
Posted: 2013-05-24T09:04:35-07:00
Hi.
I'm new to ImageMagick, and I've been trying to use the C++ API to convert an SVG file to a PNG. The problem is that the resulting PNG file's background always defaults to white. I've been searching for solutions for this, but all I find is the solution using the comand line
This command line does exactly what I want, but I can't seem to find a way to do it with the C++ API. Here is the code that I'm using to convert the image to PNG:
Is this possible to do and if so, how can I do it?
Thanks!
I'm new to ImageMagick, and I've been trying to use the C++ API to convert an SVG file to a PNG. The problem is that the resulting PNG file's background always defaults to white. I've been searching for solutions for this, but all I find is the solution using the comand line
Code: Select all
convert -background none svg_image.svg png_image.png
Code: Select all
Magick::Image svgImage(svgFilePath);
svgImage.magick("png");
Magick::Blob blob;
svgImage.write(&blob);
Thanks!