mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-06 23:43:07 +02:00
* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
27 lines
1.4 KiB
Markdown
27 lines
1.4 KiB
Markdown
---
|
|
title: "How to: Convert an Image to Greyscale"
|
|
ms.date: "03/30/2017"
|
|
dev_langs:
|
|
- "csharp"
|
|
- "vb"
|
|
helpviewer_keywords:
|
|
- "images [WPF], converting to grayscale"
|
|
- "converting [WPF], images to grayscale"
|
|
- "grayscale [WPF], converting images to"
|
|
ms.assetid: 77935ff0-4500-4307-9710-96999dcf579f
|
|
---
|
|
# How to: Convert an Image to Greyscale
|
|
This example shows how to convert an image to grayscale using <xref:System.Windows.Media.Imaging.FormatConvertedBitmap>.
|
|
|
|
## Example
|
|
[!code-xaml[ImagingSnippetGallery_snip#FormatConvertedBitmapXamlExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/ImagingSnippetGallery_snip/CS/FormatConvertedBitmapExample.xaml#formatconvertedbitmapxamlexamplewholepage)]
|
|
|
|
[!code-csharp[ImagingSnippetGallery_procedural_snip#FormatConvertedBitmapCodeExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/ImagingSnippetGallery_procedural_snip/CSharp/FormatConvertedBitmapExample.cs#formatconvertedbitmapcodeexamplewholepage)]
|
|
[!code-vb[ImagingSnippetGallery_procedural_snip#FormatConvertedBitmapCodeExampleWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/ImagingSnippetGallery_procedural_snip/VB/FormatConvertedBitmapExample.vb#formatconvertedbitmapcodeexamplewholepage)]
|
|
|
|
## See also
|
|
|
|
- [Use the Image Element](how-to-use-the-image-element.md)
|
|
- [Crop an Image](how-to-crop-an-image.md)
|
|
- [Rotate an Image](how-to-rotate-an-image.md)
|