System.Drawing.Imaging.ImageCodecInfo.GetImageEncoders()

K

kimiraikkonen

While setting an image's
imageCodecInfo(system.drawing.imaging.imagecodecinfo) as
System.Drawing.Imaging.ImageCodecInfo.GetImageEncoders(), i found out
that "GetImageEncodesr(1)" refers to jpeg and "GetImageEncoders(0)
refers to BMP and "GetImageEncoders(4) refers to PNG... I found by
trying array index numbers, the surprsing thing is there was no
definition about which array item refers to what.

There is no explict info on MSDN or on other code sites. So, if i
didn't try which GetImageEncoders array member refers to which
extension(format), how would i find and know the correct
format(extension) type without trying myself? It must be shown on MSDN
or elsewhere.
 
Joined
Jul 15, 2010
Messages
1
Reaction score
0
Solution

Hi,

You can use this code:

ImageCodecInfo.GetImageEncoders().FirstOrDefault(a=>a.FormatID == yourformat.Guid)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top