private static void SaveImageTypeByPictureBox(EMostImageType imgtype, string fname, string nfilename) { PictureBox pictureBox = new PictureBox(); pictureBox.Image = ImageHelper.LoadLocalImage(fname, true); pictureBox.Image.Save(nfilename, EMostImageTypeHelper.GetSysImgFmt(ImgTypeProcessor.DestType)); pictureBox.Dispose(); }
public static Image LoadCorectedImage(string fname) { Image image = ImageHelper.LoadLocalImage(fname, false); float num = (float)image.Width / (float)image.Height; bool flag = (double)num <0.01 || num> 100f; if (flag) { throw new Exception("您加载的图像高宽比例严重失调"); } return(image); }