如图所示,怎样转换成wpf的。picturebox我用的Image,但是whoform中也有image,我用source代替,但是还会报image的错误
void ShowImage(CaptureInfo info)
{
byte[] data = info.Data;
if (data == null || data.Length == 0)
{
return;
}
Image image = null;
using (MemoryStream ms = new MemoryStream())
{
try
{
ms.Write(data, 0, data.Length);
image = Image.FromStream(ms);
}
catch { }
}
int index = this.m_ImageIndex;
this.ShowCarImageTargetInfo(info, image);
this.ShowPersonImageTargetInfo(info, image);
if (index==this.m_ImageIndex)
{
PictureBox box = m_ImagesBox[this.m_ImageIndex];
if (box.Image != null)
{
box.Image.Dispose();
}
box.Tag = info.TargetId;
box.Image = image;
}
}
)