Hi!
I need to rasterize a svg file. I'm currently trying to use an open
source library called librsvg. I have completed all the dlls and
started writing the following wrapper:
[DllImport("librsvg-2-2.dll", SetLastError=true, CharSet =
CharSet.Auto)]
static extern IntPtr rsvg_pixbuf_from_file_at_size(string file_name,
int width, int height, out IntPtr error);
public static void LoadSvg(string fileName)
{
IntPtr error;
IntPtr result = rsvg_pixbuf_from_file_at_size(fileName, -1, -1, out
error);
if (error != IntPtr.Zero)
{
throw new Win32Exception(Marshal.GetLastWin32Error());
}
}
However the call
RsvgWrapper.LoadSvg(@"C:\M_logo.svg");
causes a "The system cannot find the file specified" Win32Excpetion.
The given file exists and is a proper svg file (The GIMP loads it and
it uses the same librsvg library).
Has anyone an idea what might be the problem or at least how to debug
it? Or perhaps some of you know a .NET svg framework other than SVG#
(www.sharpvectors.org)?