mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 09:06:04 +02:00
* Updated H2 headings for US-1889327. * Review edits. * Apply suggestions from code review Co-authored-by: Andy (Steve) De George <[email protected]>
39 lines
1.9 KiB
Markdown
39 lines
1.9 KiB
Markdown
---
|
|
title: "How to: Encode and Decode a GIF Image"
|
|
description: Learn how to Encode and Decode a GIF image.
|
|
ms.date: "03/30/2017"
|
|
ms.custom: devdivchpfy22
|
|
dev_langs:
|
|
- "csharp"
|
|
- "vb"
|
|
- "cpp"
|
|
helpviewer_keywords:
|
|
- "encoding GIF images [WPF]"
|
|
- "encoding image formats [WPF]"
|
|
- "decoding GIF images [WPF]"
|
|
- "decoding image formats [WPF]"
|
|
- "GIF decoding [WPF]"
|
|
- "GIF encoding [WPF]"
|
|
ms.assetid: 9cdd9ec7-71eb-444b-b9e3-991958461163
|
|
---
|
|
# How to: Encode and Decode a GIF Image
|
|
The following examples show how to decode and encode a Graphics Interchange Format (GIF) image using the specific <xref:System.Windows.Media.Imaging.GifBitmapDecoder> and <xref:System.Windows.Media.Imaging.GifBitmapEncoder> objects.
|
|
|
|
## Decode a GIF image
|
|
This example demonstrates how to decode a GIF image using a <xref:System.Windows.Media.Imaging.GifBitmapDecoder> from a <xref:System.IO.FileStream>.
|
|
|
|
[!code-cpp[GifBitmapDecoderEncoder#1](~/samples/snippets/cpp/VS_Snippets_Wpf/GifBitmapDecoderEncoder/CPP/GifEncoderDecoder.cpp#1)]
|
|
[!code-csharp[GifBitmapDecoderEncoder#1](~/samples/snippets/csharp/VS_Snippets_Wpf/GifBitmapDecoderEncoder/CSharp/GifEncoderDecoder.cs#1)]
|
|
[!code-vb[GifBitmapDecoderEncoder#1](~/samples/snippets/visualbasic/VS_Snippets_Wpf/GifBitmapDecoderEncoder/VB/GifEncoderDecoder.vb#1)]
|
|
|
|
## Encode a GIF image
|
|
This example demonstrates how to encode a <xref:System.Windows.Media.Imaging.BitmapSource> into a GIF image using a <xref:System.Windows.Media.Imaging.GifBitmapEncoder>.
|
|
|
|
[!code-cpp[GifBitmapDecoderEncoder#4](~/samples/snippets/cpp/VS_Snippets_Wpf/GifBitmapDecoderEncoder/CPP/GifEncoderDecoder.cpp#4)]
|
|
[!code-csharp[GifBitmapDecoderEncoder#4](~/samples/snippets/csharp/VS_Snippets_Wpf/GifBitmapDecoderEncoder/CSharp/GifEncoderDecoder.cs#4)]
|
|
[!code-vb[GifBitmapDecoderEncoder#4](~/samples/snippets/visualbasic/VS_Snippets_Wpf/GifBitmapDecoderEncoder/VB/GifEncoderDecoder.vb#4)]
|
|
|
|
## See also
|
|
|
|
- [Imaging Overview](imaging-overview.md)
|