Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

2010年11月5日 星期五

技術參考網站

.NET 技術參考網站
http://www.allenkuo.com/EBook5/view.aspx?TreeNodeID=45&id=101

Uploading Multiple Files in ASP.NET 2.0
http://www.dotnetcurry.com/ShowArticle.aspx?ID=68&AspxAutoDetectCookieSupport=1

Ajax Uploader
http://ajaxuploader.com/default.htm

Upload Multiple Files in ASP.NET using jQuery
http://www.dotnetcurry.com/ShowArticle.aspx?ID=317

Multiple File Upload With Progress Bar Using Flash and ASP.NET
http://www.codeproject.com/KB/aspnet/FlashUpload.aspx

Creating a Watermarked Photograph with GDI+ for .NET
http://www.codeproject.com/KB/GDI-plus/watermark.aspx

Upload multiple files using the HtmlInputFile control
http://dotnetslackers.com/articles/aspnet/Upload_multiple_files_using_the_HtmlInputFile_control.aspx

ASP.NET File Upload with *Real-Time* Progress Bar
http://mattberseth.com/blog/2008/07/aspnet_file_upload_with_realti.html

AJAX File Upload in ASP.NET with the AsyncFileUpload Control
http://www.mikeborozdin.com/post/AJAX-File-Upload-in-ASPNET-with-the-AsyncFileUpload-Control.aspx

Resizing a Photographic image with GDI+ for .NET
http://www.codeproject.com/KB/GDI-plus/imageresize.aspx
http://snippets.dzone.com/posts/show/1485

http://renjin.blogspot.com/2008/11/aspnet-image-uploading-with-resizing.html

High Quality Image Resizing with .NET
http://www.mikeborozdin.com/post/High-Quality-Image-Resizing-with-NET.aspx

private Bitmap ResizeImage(Stream streamImage, int maxWidth, int maxHeight)
{
Bitmap originalImage = new Bitmap(streamImage);
int newWidth = originalImage.Width;
int newHeight = originalImage.Height;
double aspectRatio = (double)originalImage.Width / (double)originalImage.Height;

if (aspectRatio <= 1 && originalImage.Width > maxWidth)
{
newWidth = maxWidth;
newHeight = (int)Math.Round(newWidth / aspectRatio);
}
else if (aspectRatio > 1 && originalImage.Height > maxHeight)
{
newHeight = maxHeight;
newWidth = (int)Math.Round(newHeight * aspectRatio);
}

Bitmap newImage = new Bitmap(originalImage, newWidth, newHeight);

Graphics g = Graphics.FromImage(newImage);
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBilinear;
g.DrawImage(originalImage, 0, 0, newImage.Width, newImage.Height);

originalImage.Dispose();

return newImage;
}


public void ResizeFromStream(string ImageSavePath, int MaxSideSize, Stream Buffer)
{
int intNewWidth;
int intNewHeight;
Image imgInput = Image.FromStream(Buffer);

//Determine image format
ImageFormat fmtImageFormat = imgInput.RawFormat;

//get image original width and height
int intOldWidth = imgInput.Width;
int intOldHeight = imgInput.Height;

//determine if landscape or portrait
int intMaxSide;

if (intOldWidth >= intOldHeight)
{
intMaxSide = intOldWidth;
}
else
{
intMaxSide = intOldHeight;
}


if (intMaxSide > MaxSideSize)
{
//set new width and height
double dblCoef = MaxSideSize / (double)intMaxSide;
i ntNewWidth = Convert.ToInt32(dblCoef * intOldWidth);
intNewHeight = Convert.ToInt32(dblCoef * intOldHeight);
}
else
{
intNewWidth = intOldWidth;
intNewHeight = intOldHeight;
}
//create new bitmap
Bitmap bmpResized = new Bitmap(imgInput, intNewWidth, intNewHeight);

//save bitmap to disk
bmpResized.Save(ImageSavePath, fmtImageFormat);

//release used resources
imgInput.Dispose();
bmpResized.Dispose();
Buffer.Close();
}



AJAX File Upload in ASP.NET with the AsyncFileUpload Control
http://geovindu.blog.163.com/blog/static/9827808201081134852274/

沒有留言:

張貼留言