Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 22nd, 2012  |  syntax: None  |  size: 0.67 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to convert jpg,bitmap format image into vector format in c#
  2. public void Run()
  3.         {
  4.             Control c = new Control();          
  5.             Graphics grfx = c.CreateGraphics();
  6.            //ReadImage(ImageName) method return the Image to Byte Array
  7.             MemoryStream ms = new MemoryStream(ReadImage(@"E:Temp1.jpg"));
  8.             IntPtr ipHdc = grfx.GetHdc();
  9.             Metafile mf = new Metafile(ms,ipHdc);
  10.             grfx.ReleaseHdc(ipHdc);
  11.             grfx.Dispose();
  12.             grfx = Graphics.FromImage(mf);
  13.             mf.Save(@"E:Tempfile.wmf", ImageFormat.Wmf);//Get Exception on this line
  14.             grfx.Dispose();
  15.         }
  16.        
  17. E:Tempfile.wmf