letter-of-resignation-mabdullah

if (FileUpload1.PostedFile != null)
{
string ImageName = “SampleImage.jpg”;
//FileUpload1.SaveAs(Server.MapPath(“Images\\”) + ImageName);

System.Drawing.Image MainImage = System.Drawing.Image.FromStream(FileUpload1.PostedFile.InputStream);
System.Drawing.Image.GetThumbnailImageAbort myCallback =
new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);
System.Drawing.Image Thumbnailimage = MainImage.GetThumbnailImage(600, 600, myCallback, IntPtr.Zero);

string ThumbnailPath = Server.MapPath(“ThumbnailImages\\”) + ImageName;
Thumbnailimage.Save(ThumbnailPath);

using (System.Drawing.Image TargetImage = Thumbnailimage)
{
using (System.Drawing.Image Thumbnail =
TargetImage.GetThumbnailImage(100, 100, myCallback, IntPtr.Zero))
{
Thumbnail.Save(Server.MapPath(“Images\\abc.jpg”));
Thumbnail.Dispose();
}
TargetImage.Dispose();
}
Thumbnailimage.Dispose();

}

if it is helpful, plese dont forget to leave a comment.

Advertisements