title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | description | ||||
---|---|---|---|---|---|---|---|---|---|
How to: List Installed Decoders |
03/30/2017 |
|
|
11417191-8c95-40ca-8024-779e61706fb6 |
Learn how to list installed decoders to determine whether your application can read a particular image file format. |
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.
The following code example outputs the list of installed decoders and their property values.
[!code-csharpUsingImageEncodersDecoders#2] [!code-vbUsingImageEncodersDecoders#2]
This example requires:
-
A Windows Forms application.
-
A xref:System.Windows.Forms.PaintEventArgs, which is a parameter of xref:System.Windows.Forms.PaintEventHandler.