////// 裁剪图片 返回服务器保存的路径 /// /// /// /// /// /// /// 文件名 /// 保存路径 ///public static string ImgCut(Bitmap bit, int startX, int startY, int iWidth, int iHeight, string filename = "1.jpeg", string dirpath = "图片保存目录") { var img = Cut(bit, startX, startY, iWidth, iHeight); if (!Directory.Exists(HttpContext.Current.Server.MapPath(dirpath))) { Directory.CreateDirectory(HttpContext.Current.Server.MapPath(dirpath)); } var filepath = dirpath + "/" + filename; img.Save(HttpContext.Current.Server.MapPath(filepath), ImageFormat.Jpeg); img.Clone(); img.Dispose(); return filepath; }