private string UploadFile(HttpPostedFileBase postedFile)
{
if (postedFile.ContentLength > 0)
{
var filename = Path.GetFileName(postedFile.FileName);
System.Drawing.Image sourceimage =
System.Drawing.Image.FromStream(postedFile.InputStream);
Bitmap newImage = new Bitmap(5, 5);
using (Graphics gr = Graphics.FromImage(newImage))
{
gr.SmoothingMode = SmoothingMode.HighQuality;
gr.InterpolationMode = InterpolationMode.HighQualityBicubic;
gr.PixelOffsetMode = PixelOffsetMode.HighQuality;
gr.DrawImage(sourceimage, new Rectangle(0, 0, 5, 5));
}
}
}
{
if (postedFile.ContentLength > 0)
{
var filename = Path.GetFileName(postedFile.FileName);
System.Drawing.Image sourceimage =
System.Drawing.Image.FromStream(postedFile.InputStream);
Bitmap newImage = new Bitmap(5, 5);
using (Graphics gr = Graphics.FromImage(newImage))
{
gr.SmoothingMode = SmoothingMode.HighQuality;
gr.InterpolationMode = InterpolationMode.HighQualityBicubic;
gr.PixelOffsetMode = PixelOffsetMode.HighQuality;
gr.DrawImage(sourceimage, new Rectangle(0, 0, 5, 5));
}
}
}
0 comments:
Post a Comment