WPF:显示快速变化的图像的更有效方法? [英] WPF: More efficient way of displaying quickly-changing images?

查看:93
本文介绍了WPF:显示快速变化的图像的更有效方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Image 控件显示我在后台线程上处理的8位灰度图像.处理完图像后,我将Image.BitmapSource属性设置为指向通过 BitmapSource.Create()创建的新位图.很好-直到我必须快速重新处理图像并将其放回屏幕上.

I'm using the Image control to display an 8-bit grayscale image that I process myself on a background thread. Once the image is processed, I set the Image.BitmapSource property to point to a new bitmap I create via BitmapSource.Create(). This is all well and good - until I have to rapidly reprocess the image and throw it back on screen.

我正在处理的项目要求我能够以约15-20 FPS的速度重新处理和刷新图像.我可以快速将图像发送到UI,这不是问题.问题是显示屏以不愉快的方式闪烁.我想避免这种情况.

The project that I'm working on requires that I be able to reprocess and refresh the image at ~15-20 FPS. I can get images to the UI that fast - that isn't the problem. The problem is the display flickers in an unpleasant way. I'd like to avoid this.

我的项目的WPF之前版本依靠GDI来做到这一点,并且能够处理而不会出现闪烁.我宁愿不使用GDI(或GDI +).

Pre-WPF versions of my project relied on GDI to do this and were able to handle it without the flickering. I'd prefer to not use GDI (or GDI+).

是否有更有效的WPF方法?

Is there a more efficient WPF-way of doing this?

推荐答案

我认为之前已经问过一个问题,

I think question has been asked before, here.

这篇关于WPF:显示快速变化的图像的更有效方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆