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