--- title: "How to: Convert a BitmapSource to a Different PixelFormat" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "BitmapSource objects [WPF], converting to indexed pixel format" - "converting images [WPF]" - "converting [WPF], BitmapSource objects to indexed pixel formats" - "converting [WPF], BitmapSource objects to palettized pixel format" - "BitmapSource objects [WPF], converting to palettized pixel format" ms.assetid: cd9df1e4-d5dc-4f57-b67b-4ec67e086b33 --- # How to: Convert a BitmapSource to a Different PixelFormat This example demonstrates how to convert a object () to a different using a . ## Example [!code-csharp[ImagingSnippetGallery_procedural_snip#PixelFormatConversion](~/samples/snippets/csharp/VS_Snippets_Wpf/ImagingSnippetGallery_procedural_snip/CSharp/PixelFormatsExample.cs#pixelformatconversion)] [!code-vb[ImagingSnippetGallery_procedural_snip#PixelFormatConversion](~/samples/snippets/visualbasic/VS_Snippets_Wpf/ImagingSnippetGallery_procedural_snip/VB/PixelFormatsExample.vb#pixelformatconversion)] ## See also - [Imaging Overview](imaging-overview.md)