--- title: "How to: Encode and Decode a WDP Image" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" - "cpp" helpviewer_keywords: - "WDP encoding [WPF]" - "WDP decoding [WPF]" - "encoding image formats [WPF]" - "decoding WDP images [WPF]" - "decoding image formats [WPF]" - "encoding WDP images [WPF]" ms.assetid: 911777d1-516b-49db-a87b-b54e31b18532 --- # How to: Encode and Decode a WDP Image The following examples show how to decode and encode a Microsoft Windows Media Photo image using the specific and objects. ## Example This example demonstrates how to decode a Windows Media Photo image using a from a . [!code-cpp[WdpBitmapDecoderEncoder#1](~/samples/snippets/cpp/VS_Snippets_Wpf/WdpBitmapDecoderEncoder/CPP/WDPEncoderDecoder.cpp#1)] [!code-csharp[WdpBitmapDecoderEncoder#1](~/samples/snippets/csharp/VS_Snippets_Wpf/WdpBitmapDecoderEncoder/CSharp/WDPEncoderDecoder.cs#1)] [!code-vb[WdpBitmapDecoderEncoder#1](~/samples/snippets/visualbasic/VS_Snippets_Wpf/WdpBitmapDecoderEncoder/VB/WDPEncoderDecoder.vb#1)] ## Example This example demonstrates how to encode a into a Windows Media Photo image using a . [!code-cpp[WdpBitmapDecoderEncoder#4](~/samples/snippets/cpp/VS_Snippets_Wpf/WdpBitmapDecoderEncoder/CPP/WDPEncoderDecoder.cpp#4)] [!code-csharp[WdpBitmapDecoderEncoder#4](~/samples/snippets/csharp/VS_Snippets_Wpf/WdpBitmapDecoderEncoder/CSharp/WDPEncoderDecoder.cs#4)] [!code-vb[WdpBitmapDecoderEncoder#4](~/samples/snippets/visualbasic/VS_Snippets_Wpf/WdpBitmapDecoderEncoder/VB/WDPEncoderDecoder.vb#4)] ## See also - [Imaging Overview](imaging-overview.md)