Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

16 bit grayscale image display in WPF

Tags:

I am developing an application that displays 16 bit grayscale images. 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. Within the last few months we have convert the UI to WPF, but continued to use the openGL image display via a WindowsFormsHost.

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? or will I have to create a DirectX control?

Also, the openGL control isn't only used to display the image data. 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? 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?

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?

like image 444
Dan Vogel Avatar asked Jul 07 '09 17:07

Dan Vogel


1 Answers

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.

Greg Schechter's covered how to write a custom effect in his blog

like image 140
Shay Erlichmen Avatar answered Oct 27 '22 11:10

Shay Erlichmen