Get Image Encoder Info - CSharp System.Drawing.Imaging

CSharp examples for System.Drawing.Imaging:Bitmap

Description

Get Image Encoder Info

Demo Code


using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Drawing;
using System.IO;/*ww  w .j a va 2  s  . c om*/
using System.Collections;
using System;

public class Main{

        private static ImageCodecInfo GetEncoderInfo(String mimeType)
        {
            int j;
            ImageCodecInfo[] encoders;
            encoders = ImageCodecInfo.GetImageEncoders();
            for (j = 0; j < encoders.Length; ++j)
            {
                if (encoders[j].MimeType == mimeType)
                    return encoders[j];
            }
            return null;
        }
}

Related Tutorials