TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Johann Montfort
NA
4
0
image resize
Aug 17 2005 1:28 AM
Dear All, I have found a function on the net to resize my images, however, when i am debugging it, it is giving me an exception. This is the function:- private static void GenerateImage(string sPhysicalPath,string sOrgFileName,ImageFormat oFormat, int image_width, int image_height) { try { System.Drawing.Image oImg = System.Drawing.Image.FromFile(sPhysicalPath + sOrgFileName); System.Drawing.Image oThumbNail = new Bitmap(image_width, image_height, oImg.PixelFormat); Graphics oGraphic = Graphics.FromImage(oThumbNail); oGraphic.CompositingQuality = CompositingQuality.HighQuality ; oGraphic.SmoothingMode = SmoothingMode.HighQuality ; oGraphic.InterpolationMode = InterpolationMode.HighQualityBicubic ; Rectangle oRectangle = new Rectangle(0, 0, image_width, image_height); oGraphic.DrawImage(oImg, oRectangle); oThumbNail.Save(sPhysicalPath + sOrgFileName,oFormat); oImg.Dispose(); } catch (Exception ex) { //exception StringBuilder strImgExc = new StringBuilder(); strImgExc.Append(ex.Message); } } Now these are the values when i debug:- sPhysicalPath = @"c:\inetpub\wwwroot\ImageConsole\Images_Folder\" sOrgFileName = "test.jpg" ex (System Exception) = {@"c:\inetpub\wwwroot\ImageConsole\Images_Folder\test.jpg" } Can anybody tell me what am i doing wrong? Does the sPhysicalPath has to be different? Thanks for your help and time Johann
Reply
Answers (
0
)
please help! this is urgent> how to retrieve data to my tabpage without using data form wizard?
How To Call any .exe in In C#