Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 1.68 KB

how-to-list-installed-decoders.md

File metadata and controls

35 lines (25 loc) · 1.68 KB
title ms.date dev_langs helpviewer_keywords ms.assetid description
How to: List Installed Decoders
03/30/2017
csharp
vb
image codecs [Windows Forms], listing
image decoders [Windows Forms], listing
11417191-8c95-40ca-8024-779e61706fb6
Learn how to list installed decoders to determine whether your application can read a particular image file format.

How to: List Installed Decoders

You may want to list the image decoders available on a computer, to determine whether your application can read a particular image file format. The xref:System.Drawing.Imaging.ImageCodecInfo class provides the xref:System.Drawing.Imaging.ImageCodecInfo.GetImageDecoders%2A static methods so that you can determine which image decoders are available. xref:System.Drawing.Imaging.ImageCodecInfo.GetImageDecoders%2A returns an array of xref:System.Drawing.Imaging.ImageCodecInfo objects.

Example

The following code example outputs the list of installed decoders and their property values.

[!code-csharpUsingImageEncodersDecoders#2] [!code-vbUsingImageEncodersDecoders#2]

Compiling the Code

This example requires:

  • A Windows Forms application.

  • A xref:System.Windows.Forms.PaintEventArgs, which is a parameter of xref:System.Windows.Forms.PaintEventHandler.

See also