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
Invalid Parameter Used
Aug 18 2005 5:35 AM
Dear All, I have created a function to resize an image and save it to the server. This is the code:- try { System.Drawing.Image NewImg; System.Drawing.Image.GetThumbnailImageAbort dummyCallBack = new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback); NewImg = fullSizeImg.GetThumbnailImage(image_width, image_height, dummyCallBack, IntPtr.Zero); NewImg.Save(path + image_name); int x = image_width; int y = image_height; string image_path = path + "\\" + image_name; Image oImg = Image.FromFile(image_path); Bitmap bmp = new Bitmap(x,y); System.Drawing.Imaging.Encoder Enc = System.Drawing.Imaging.Encoder.Transformation; EncoderParameters EncParms = new EncoderParameters(1); EncoderParameter EncParm; Graphics gr = Graphics.FromImage(bmp); gr.CompositingQuality = CompositingQuality.HighQuality; gr.SmoothingMode = SmoothingMode.HighQuality; gr.InterpolationMode = InterpolationMode.HighQualityBicubic; gr.DrawImage(oImg, 0, 0, x, y); gr.Save(); EncParms.Param = new EncoderParameter[] { new EncoderParameter(Enc,(long)EncoderValue.CompressionLZW), new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100L) }; ImageCodecInfo ici ; ici = GetProperEncoder(image_name); bmp.Save(image_path, ici, EncParms); oImg.Dispose(); bmp.Dispose(); } catch (Exception e) { Console.WriteLine("Caught: {0}",e.Message); } However I am getting an exception on this line :- bmp.Save(image_path, ici, EncParms); The exception is System.Object {System.ArgumentException} "Invalid Parameter Used" Can anybody help me please? Thanks for your help and time
Reply
Answers (
0
)
Can we handle DataGrid Navigation Like
TabControl moves two places..