How to implement picture zoom in C #

xiaoxiao2021-03-06  64

// ******************************************************** *********** //// 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) /// Save as file name (including path) /// zoom to the width /// 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 /// /// source diagram file name (including path) /// Save after zooming To file names (including path) ////

StrolDPIC "> Source Map file name (including path) /// saved as file name (including path) /// reduced to a height 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/

转载请注明原文地址:https://www.9cbs.com/read-90339.html

New Post(0)