* 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
1.8 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| How to: Encode and Decode a PNG Image | 03/30/2017 |
|
|
3d31d186-af73-47f0-b5a7-c26ae46409a6 |
How to: Encode and Decode a PNG Image
The following examples show how to decode and encode a Portable Network Graphics (PNG) image using the specific xref:System.Windows.Media.Imaging.PngBitmapDecoder and xref:System.Windows.Media.Imaging.PngBitmapEncoder objects.
Example
This example demonstrates how to decode a PNG image using a xref:System.Windows.Media.Imaging.PngBitmapDecoder from a xref:System.IO.FileStream.
[!code-cppPngBitmapDecoderEncoder#1] [!code-csharpPngBitmapDecoderEncoder#1] [!code-vbPngBitmapDecoderEncoder#1]
Example
This example demonstrates how to encode a xref:System.Windows.Media.Imaging.BitmapSource into a PNG image using a xref:System.Windows.Media.Imaging.PngBitmapEncoder.
[!code-cppPngBitmapDecoderEncoder#4] [!code-csharpPngBitmapDecoderEncoder#4] [!code-vbPngBitmapDecoderEncoder#4]