// ******************************************************** *********** //// The following is given three simple methods, and the following two methods are extensions, and it is estimated that sometimes use // ********** ********************************************************* / / /// /// 小 图片 /// Source diagram file name (including path) param> /// Save as file name (including path) param> /// zoom to the width param> /// shrink to height < / param> public void SmallPic (string strOldPic, string strNewPic, int intWidth, int intHeight) {System.Drawing.Bitmap objPic, objNewPic; try {objPic = new System.Drawing.Bitmap (strOldPic); objNewPic = new System.Drawing. Bitmap (ObjPic, INTWIDTH, INTHEIGHT); ObjnewPic.save (StrnewPic);} catch (exception exp) {throw exp;} finally {objPic = null; objnewpic = null;}} /// /// proportion Reproduction the picture, automatically calculate the height /// summary> /// source diagram file name (including path) param> /// Save after zooming To file names (including path) param> ////
StrolDPIC "> Source Map file name (including path) param> /// saved as file name (including path) param> /// reduced to a height param> public void SmallPic (string strOldPic, string strNewPic, int intHeight) {System.Drawing.Bitmap objPic, objNewPic; try {objPic = new System.Drawing.Bitmap (strOldPic); int intWidth = (intHeight / objPic.Height) * objPic.Width; objNewPic = new System.Drawing.Bitmap (objPic, intWidth, intHeight); objNewPic.Save (strNewPic);} catch (Exception exp) {throw exp;} finally {objPic = null; Objnewpic = null;}} // ***************************************************** ****************** //// 天 2004-11-5 // QQ: 37878073 (I hope to exchange with everyone)
Author Blog:
http://blog.9cbs.net/tangzehuan/