简体   繁体   English

WPF中的16位灰度图像显示

[英]16 bit grayscale image display in WPF

I am developing an application that displays 16 bit grayscale images. 我正在开发一个显示16位灰度图像的应用程序。 The UI for the application was originally created using Win Forms and since Win Forms does not support 16 bit grayscale I wrote a custom openGL control to display the image. 应用程序的UI最初是使用Win Forms创建的,由于Win Forms不支持16位灰度,我编写了一个自定义的openGL控件来显示图像。 Within the last few months we have convert the UI to WPF, but continued to use the openGL image display via a WindowsFormsHost. 在过去的几个月里,我们将UI转换为WPF,但继续通过WindowsFormsHost使用openGL图像显示。

WPF is DirectX based so it would make sense to try and get away from the openGL, but does WPF natively support 16 bit grayscale images? WPF是基于DirectX的,因此尝试远离openGL是有意义的,但WPF本身是否支持16位灰度图像? or will I have to create a DirectX control? 或者我是否必须创建DirectX控件?

Also, the openGL control isn't only used to display the image data. 此外,openGL控件不仅用于显示图像数据。 The contol allows the user to manipulate the image in various ways (Flip, rotate, Zoom, pan, crop, etc); 控制器允许用户以各种方式操作图像(翻转,旋转,缩放,平移,裁剪等); as well as annotate the image (draw lines, rectangles, measurement angles, etc). 以及注释图像(绘制线条,矩形,测量角度等)。 If I'm simply using WPF to display the image, how can I also manipulate and annotate using WPF? 如果我只是使用WPF来显示图像,我怎样才能使用WPF进行操作和注释? Plus, I am using a shader to do some color mapping on the image texture. 另外,我使用着色器在图像纹理上进行一些颜色映射。 Is something like this possible with WPF or will I have to color map the image data manually before displaying? WPF是否可以这样,或者我必须在显示前手动对图像数据进行颜色映射?

I have never used DirectX, so if writing a DirectX control is necessary how difficult will it be to learn and implement what I need? 我从未使用过DirectX,所以如果需要编写DirectX控件,学习和实现我需要的东西有多难?

As for the shaders parts, WPF have access to the HW shaders ( and it can emulated them in SW if needed ) they are called bitmap effects . 对于着色器部件,WPF可以访问HW着色器( 如果需要,它可以在SW中模拟它们 ),它们被称为位图效果

Greg Schechter's covered how to write a custom effect in his blog Greg Schechter介绍了如何在他的博客中编写自定义效果

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM