--- title: "How to: Encode and Decode a BMP Image" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" - "cpp" helpviewer_keywords: - "encoding BMP images [WPF]" - "BMP encoding [WPF]" - "decoding BMP images [WPF]" - "encoding image formats [WPF]" - "BMP decoding [WPF]" - "decoding image formats [WPF]" ms.assetid: feb5ef27-28ac-40ab-bfc2-e0456990d32c --- # How to: Encode and Decode a BMP Image The following examples show how to decode and encode a bitmap (BMP) image using the specific and objects. ## Example This example demonstrates how to decode a BMP image using a from a . [!code-cpp[BmpBitmapDecoderEncoder#5](~/samples/snippets/cpp/VS_Snippets_Wpf/BmpBitmapDecoderEncoder/CPP/anotherfile.cpp#5)] [!code-csharp[BmpBitmapDecoderEncoder#5](~/samples/snippets/csharp/VS_Snippets_Wpf/BmpBitmapDecoderEncoder/CSharp/BitmapFrame.cs#5)] [!code-vb[BmpBitmapDecoderEncoder#5](~/samples/snippets/visualbasic/VS_Snippets_Wpf/BmpBitmapDecoderEncoder/VB/BitmapFrame.vb#5)] ## Example This example demonstrates how to encode a into a BMP image using a . [!code-cpp[BmpBitmapDecoderEncoder#4](~/samples/snippets/cpp/VS_Snippets_Wpf/BmpBitmapDecoderEncoder/CPP/anotherfile.cpp#4)] [!code-csharp[BmpBitmapDecoderEncoder#4](~/samples/snippets/csharp/VS_Snippets_Wpf/BmpBitmapDecoderEncoder/CSharp/BitmapFrame.cs#4)] [!code-vb[BmpBitmapDecoderEncoder#4](~/samples/snippets/visualbasic/VS_Snippets_Wpf/BmpBitmapDecoderEncoder/VB/BitmapFrame.vb#4)] ## See also - [Imaging Overview](imaging-overview.md)