Created
March 28, 2015 14:59
-
-
Save turibbio/a325f52ace07ab4e685b to your computer and use it in GitHub Desktop.
create thumbnails in C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Salva la mia foto con dimensioni normali | |
string myImage = Server.MapPath("~/") + "public/images/" + fuImg.FileName; | |
fuImg.SaveAs(myImage); | |
//crea e salva il thumbinail | |
System.Drawing.Image img = System.Drawing.Image.FromFile(myImage); | |
System.Drawing.Image.GetThumbnailImageAbort myCallback = new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback); | |
System.Drawing.Image myThumbnail = img.GetThumbnailImage(65, 65, myCallback, IntPtr.Zero); | |
myThumbnail.Save(Server.MapPath("~/") + "public/thumbs/" + fuImg.FileName); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment