Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 10,504 times

Downloads

Related Categories

GDI+ Image Encoder and Decoder Info - Encoders and Decoders

Nimpo

Encoders and Decoders




This piece of code enumerates every built in Encoder and Decoder that comes with GDI+.  You would use the same concept to gain informartion about any other Encoder/Decoder.







Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ImageDecoders() As Imaging.ImageCodecInfo = Imaging.ImageCodecInfo.GetImageDecoders
Dim ImageEncoders() As Imaging.ImageCodecInfo = Imaging.ImageCodecInfo.GetImageEncoders
Dim strInfo As String
Dim i As Integer

strInfo &= "Built-in GDI+ Image Decoders:" & ControlChars.NewLine & ControlChars.NewLine

For i = 0 To ImageDecoders.GetUpperBound(0)
With ImageDecoders(i)
strInfo &= "Codec Name: " & .CodecName & ControlChars.NewLine
strInfo &= "Dll Name: " & CType(IIf(.DllName <> String.Empty, .DllName, "N/A"), String) & _
ControlChars.NewLine
strInfo &= "File Extension(s): " & .FilenameExtension & ControlChars.NewLine
strInfo &= "Format Description: " & .FormatDescription & ControlChars.NewLine
strInfo &= "Mime Type: " & .MimeType & ControlChars.NewLine
strInfo &= "Version: " & .Version & ControlChars.NewLine & ControlChars.NewLine
End With
Next

strInfo = strInfo.Substring(0, strInfo.Length - 4)
txtDecoders.Text = strInfo

strInfo = ""
strInfo &= "Built-in GDI+ Image Encoders:" & ControlChars.NewLine & ControlChars.NewLine

For i = 0 To ImageEncoders.GetUpperBound(0)
With ImageEncoders(i)
strInfo &= "Codec Name: " & .CodecName & ControlChars.NewLine
strInfo &= "Dll Name: " & CType(IIf(.DllName <> String.Empty, .DllName, "N/A"), String) & _
ControlChars.NewLine
strInfo &= "File Extension(s): " & .FilenameExtension & ControlChars.NewLine
strInfo &= "Format Description: " & .FormatDescription & ControlChars.NewLine
strInfo &= "Mime Type: " & .MimeType & ControlChars.NewLine
strInfo &= "Version: " & .Version & ControlChars.NewLine & ControlChars.NewLine
End With
Next

strInfo = strInfo.Substring(0, strInfo.Length - 4)
txtEncoders.Text = strInfo
End Sub

Languages I know (from most comfortable with, to least comfortable with): VB.NET, C#, VB6, and C/C++

I'm 18 years old and pursuing a BS in Computer Science at the Colorado School of Mines. My dad introduced me to programming (with Visual Basic 6) when I was about 10. When I was 13 I was accepted and enrolled at Arapahoe Community College for a programming class and continued there during the summers while in high school.


Check me out!

Comments