R
rrutkowski
Hi!
I need to rasterize a svg file in a .NET project. Currently I'm trying
to use an open source library called librsvg. I've 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 following call
RsvgWrapper.LoadSvg(@"C:\M_logo.svg");
causes a "The system cannot find the file specified" Win32Exception to
be thrown. The given file exists and is a proper SVG file (the GIMP
loads it fine and it uses the same librsvg library).
Does anyone has an idea, what might be causing the problem?
I need to rasterize a svg file in a .NET project. Currently I'm trying
to use an open source library called librsvg. I've 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 following call
RsvgWrapper.LoadSvg(@"C:\M_logo.svg");
causes a "The system cannot find the file specified" Win32Exception to
be thrown. The given file exists and is a proper SVG file (the GIMP
loads it fine and it uses the same librsvg library).
Does anyone has an idea, what might be causing the problem?