2 cwt19902010 cwt19902010 于 2017.09.13 23:09 提问

winform的代码怎么样转成wpf的 5C

如图所示,怎样转换成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;
            }

        }

)

1个回答

caozhy
caozhy   Ds   Rxr 2017.09.14 08:30

这鬼才看得清你的问题。

cwt19902010
cwt19902010 你好,请再帮忙看下,作为是图片压缩没传成功
2 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片