How can I convert an Image to grayscale ?

Platform: WPF| Category: Image

This can be done by using the ‘FormatConvertedBitmap’ class. The image is converted to the spcified PixedFormat type.

The following code snippet shows the conversion of an image to grayscale.

[XAML]
<Image Width='200' Height='200' >
	<Image.Source>
		<FormatConvertedBitmap Source='C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Winter.jpg' DestinationFormat='Gray4' />
	</Image.Source>
</Image>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.