Tuesday, 28 August 2012



Convert from System.Drawing.Image to System.Windows.Controls.Image


 private void updatePictureBox(Image pic, System.Drawing.Image value)
        {
            if (pic.Dispatcher.Thread == Thread.CurrentThread)
            {



                System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(value);
                IntPtr hBitmap = bmp.GetHbitmap();
                System.Windows.Media.ImageSource WpfBitmap = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
                pic.Source = WpfBitmap;
            }
}