/***************WPF Image控件***************/
System.Windows.Controls;
class Image : FrameworkElement, IUriContext, IProvidePropertyFallback
Image.Source = BitmapSource.Create(...);
/***************Emgu ImageBox控件***************/
Emgu.CV.UI;
class ImageBox : PanAndZoomPictureBox
Image<Bgr, Byte> img = new Image<Bgr, byte>(320, 240, new Bgr(255, 0, 0));
Mat img = new Mat(200, 400, DepthType.Cv8U, 3);
img.SetTo(new Bgr(255, 0, 0).MCvScalar);
IntPtr img = CvInvoke.cvCreateImage(CvInvoke.cvGetSize(scr),
Emgu.CV.CvEnum.IPL_DEPTH.IPL_DEPTH_8U, 1);
CvInvoke.cvCopy(scr, img, IntPtr.Zero);
ImageBox.Image = img;
/***************WinForm PictureBox控件***************/
System.Windows.Forms;
class PictureBox : Control, ISupportInitialize
PictureBox.Image =
IntPtr scr = CvInvoke.cvLoadImage(filename, Emgu.CV.CvEnum.LOAD_IMAGE_TYPE.CV_LOAD_IMAGE_ANYCOLOR);
Image<Bgr, byte> img = new Image<Bgr, byte>(CvInvoke.cvGetSize(scr));
CvInvoke.cvCopy(scr, img, IntPtr.Zero);
PictureBox.Image = img.ToBitmap();