Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-encode-and-decode-a-tiff-image.md
T
Pooja PoojariandAndy De George 6d665a13bd US-1889327: Updated H2 headings. (#1323)
* Updated H2 headings for US-1889327.

* Review edits.

* Apply suggestions from code review

Co-authored-by: Andy (Steve) De George <[email protected]>
2022-03-04 18:48:05 +00:00

39 lines
2.0 KiB
Markdown

---
title: "How to: Encode and Decode a TIFF Image"
description: Learn how to Encode and Decode a TIFF image.
ms.date: "03/30/2017"
ms.custom: devdivchpfy22
dev_langs:
- "csharp"
- "vb"
- "cpp"
helpviewer_keywords:
- "TIFF encoding [WPF]"
- "encoding TIFF images [WPF]"
- "encoding image formats [WPF]"
- "decoding TIFF images [WPF]"
- "decoding image formats [WPF]"
- "TIFF decoding [WPF]"
ms.assetid: 1dfe3209-fc73-40e6-ad1c-71c1c58b3364
---
# How to: Encode and Decode a TIFF Image
The following examples show how to decode and encode a Tagged Image File Format (TIFF) image using the specific <xref:System.Windows.Media.Imaging.TiffBitmapDecoder> and <xref:System.Windows.Media.Imaging.TiffBitmapEncoder> objects.
## Decode a TIFF image
This example demonstrates how to decode a TIFF image using a <xref:System.Windows.Media.Imaging.TiffBitmapDecoder> from a <xref:System.Uri>.
[!code-cpp[TiffBitmapDecoderEncoder#1](~/samples/snippets/cpp/VS_Snippets_Wpf/TiffBitmapDecoderEncoder/CPP/TiffEncoderDecoder.cpp#1)]
[!code-csharp[TiffBitmapDecoderEncoder#1](~/samples/snippets/csharp/VS_Snippets_Wpf/TiffBitmapDecoderEncoder/CSharp/TiffEncoderDecoder.cs#1)]
[!code-vb[TiffBitmapDecoderEncoder#1](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TiffBitmapDecoderEncoder/VB/TiffEncoderDecoder.vb#1)]
## Encode a TIFF image
This example demonstrates how to encode a <xref:System.Windows.Media.Imaging.BitmapSource> into a TIFF image using a <xref:System.Windows.Media.Imaging.TiffBitmapEncoder>.
[!code-cpp[TiffBitmapDecoderEncoder#4](~/samples/snippets/cpp/VS_Snippets_Wpf/TiffBitmapDecoderEncoder/CPP/TiffEncoderDecoder.cpp#4)]
[!code-csharp[TiffBitmapDecoderEncoder#4](~/samples/snippets/csharp/VS_Snippets_Wpf/TiffBitmapDecoderEncoder/CSharp/TiffEncoderDecoder.cs#4)]
[!code-vb[TiffBitmapDecoderEncoder#4](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TiffBitmapDecoderEncoder/VB/TiffEncoderDecoder.vb#4)]
## See also
- [Imaging Overview](imaging-overview.md)