CSharp examples for System.Drawing.Imaging:ImageFormat
Get Image Encoder from ImageFormat
using System.Linq; using System.Threading.Tasks; using System.Drawing.Imaging; using System.Drawing; using System.Collections.Generic; using System;/*from w w w . jav a2 s . co m*/ public class Main{ static ImageCodecInfo GetEncoder(ImageFormat format) { ImageCodecInfo[] codecs = ImageCodecInfo.GetImageDecoders(); return codecs.Single(codec => codec.FormatID == format.Guid); } }