Hi!
I would like to resize files that are being uploaded automatically. But I only want to resize the width. Regarding the height of the file, this should auto adjust it self. Forexample; If I'm uploading a file that is 1000 px in width and 2000px in height and then resize it to 500px in width, then I want the height to be auto resized to 1000px. In other words the height and width has to be proportional.
This is the code that I'm using right now.
int width = 500;
int height = 500;
using (System.Drawing.Image thumbnail = originalImage.GetThumbnailImage(width, height, thumbnailImageAbortDelegate, IntPtr.Zero))
{
string thumbnailFileName = Path.Combine(target, string.Format("{0}_BigPicture{1}", file.GetNameWithoutExtension(), file.GetExtension()));
thumbnail.Save(thumbnailFileName);
The problem with this is that is has to take both the height and the width. I cannot leave out the height parameter.
P.S. My DLL version is 2009.3.1208.35 > Telerik.Web.UI.dll (ASP.NET Ajax)
So I hope someone can help.
Thanks
I would like to resize files that are being uploaded automatically. But I only want to resize the width. Regarding the height of the file, this should auto adjust it self. Forexample; If I'm uploading a file that is 1000 px in width and 2000px in height and then resize it to 500px in width, then I want the height to be auto resized to 1000px. In other words the height and width has to be proportional.
This is the code that I'm using right now.
int width = 500;
int height = 500;
using (System.Drawing.Image thumbnail = originalImage.GetThumbnailImage(width, height, thumbnailImageAbortDelegate, IntPtr.Zero))
{
string thumbnailFileName = Path.Combine(target, string.Format("{0}_BigPicture{1}", file.GetNameWithoutExtension(), file.GetExtension()));
thumbnail.Save(thumbnailFileName);
The problem with this is that is has to take both the height and the width. I cannot leave out the height parameter.
P.S. My DLL version is 2009.3.1208.35 > Telerik.Web.UI.dll (ASP.NET Ajax)
So I hope someone can help.
Thanks