![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3
![]() |
Resizing an Image in .NET
hi everyone,
its been a while since my last anything at the forums, here is a question on resizing an Image in the .NET .. C#, VB, C++, doesnt matter basicly what im doing is declaring an image file like this: Image myImage = Image.fromFile("picture.jpeg");so how is that possible..? Does the sizeconverter class do the job? if yes, how can i use the "Type" class to represent my new imgae size ? thanks everyone, happy new year |
|
|
|
|
|
#2 |
|
Professional Programmer
|
Have you tried searching first ? http://www.codeproject.com/csharp/imageresize.asp
__________________
Don't take life too seriously, it's not permanent ! |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3
![]() |
Thanks for the feedback xavier
For archives of the forums, here is a simple way of resizing an image in .NET Size ResizedDimensions = new Size(192, 140);
Image tempImg = Image.FromFile("ImagetoResize.jpeg");
Bitmap NewBmp = new Bitmap(tempImg, ResizedDimensions);
tempImg.Dispose();
NewBmp.Save("resizedImage.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
NewBmp.Dispose(); |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Image corruption on some systems | slyadams | Java | 0 | Jun 1st, 2006 10:40 AM |
| Image float, wrap text, oh boy! | DaveQB | HTML / XHTML / CSS | 1 | May 20th, 2006 1:34 AM |
| Image Viewer (Urgent Bèta testing) | SoniX | Visual Basic .NET | 8 | Sep 21st, 2005 6:25 PM |
| Pragmatic image manipulation (resizing) | kurifu | C# | 2 | Aug 25th, 2005 7:52 PM |
| Checking source codes of image, audio and video files | on_auc | C++ | 3 | Feb 21st, 2005 9:36 PM |