using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.IO;
using System.Drawing.Imaging;
using System.Reflection;
namespace SuchSofts.OpenImage.Lib.Operation
{
internal class CommonOperations
{
publicstatic string GetImageExtension(System.Drawing.Image image)
{
Type Type = typeof(ImageFormat);
System.Reflection.PropertyInfo[] imageFormatList = Type.GetProperties(BindingFlags.Static | BindingFlags.Public);
for (int i = 0; i != imageFormatList.Length; i++)
{
ImageFormat formatClass = (ImageFormat)imageFormatList[i].GetValue(null, null);
if (formatClass.Guid.Equals(image.RawFormat.Guid))
{
return imageFormatList[i].Name.ToLower();
}
}
return "";
}
}
}