using the. Net method to getthumbnailimage the resulting thumbnail is highly distorted, and here is a recommended method for generating thumbnails without distortion
Code as follows:///<summary>///get thumbnail///</summary>///<returns></returns> public bool Getthumbi MG () {try {string Imgpath;//original path if (Imgsourceurl. IndexOf ("", 0) <0)//using the relative path {Imgpath = HttpContext.Current.Server.MapPath (Imgsourceurl); Convert to physical path &NBSP;} else {imgpath=imgsourceurl;} System.Drawing.Image sourceimage = System.Drawing.Image.FromFile (Imgpath); int width = sourceimage.width; int height = sourceimage.height; if (thumbwidth <= 0) {thumbwidth = <;} if (Thumbwidth >= width) {return false;} else {(Thumbwidth,thheight*thum Bwidth/thwidth,null,intptr.zero); Image imgthumb=new System.Drawing.Bitmap (thumbwidth,height*thumbwidth/width); System.Drawing.Graphics g = System.Drawing.Graphics.FromImage (Imgthumb); G.interpolationmode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; G.drawimage (Sourceimage, New Rectangle (0, 0, Thumbwidth,height*thumbwidth/width), 0, 0, width, HeigHT, GraphicsUnit.Pixel); String Thumbpath= ""; Sourceimage.dispose (); if (thumburl== "") {Thumbpath=imgpath;} if (Thumbpath. IndexOf ("", 0) <0)//is used relative path {thumbpath=httpcontext.current.server.mappath (thumburl); Convert to physical path } imgthumb.save (Thumbpath,imageformat.jpeg); Imgthumb.dispose (); return true; The catch {Throw}}}