I try to convert the jpg image into vector format.I try to implement this code but it's through the exeception
public void Run()
{
Control c = new Control();
Graphics grfx = c.CreateGraphics();
//ReadImage(ImageName) method return the Image to Byte Array
MemoryStream ms = new MemoryStream(ReadImage(@"E:\Temp\1.jpg"));
IntPtr ipHdc = grfx.GetHdc();
Metafile mf = new Metafile(ms,ipHdc);
grfx.ReleaseHdc(ipHdc);
grfx.Dispose();
grfx = Graphics.FromImage(mf);
mf.Save(@"E:\Temp\file.wmf", ImageFormat.Wmf);//Get Exception on this line
grfx.Dispose();
}
Exeception is :A generic error occurred in GDI+. Please verify my code where i did the mistake. Thanks in Advance
I got the same error before in my application the problem occured becouse of writing file to disk so as yours
check the file permission for write! My directory was Mapped Memory in network so i had to connect directory with pass and username.Make sure that the parent directory exists and Ensure that path includes both the filename and extension.if its not work try to run program as admin