CImageLibrary类修复GetImageBytes方法获取图片大小
CImageLibrary类修复GetImageBytes方法获取图片大小
C# Code:
public static byte[] GetImageBytes(Image img, ImageFormat format)
{
if (img == null) return null;
MemoryStream ms1 = new MemoryStream();
try
{
img.Save(ms1, format);
byte[] bs1 = ms1.ToArray();
ms1.Close();
return bs1;
}
catch
{
ms1.Close();
return null;
}
}