Click here to Skip to main content
15,867,895 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have written the code to upload the image and display the image. But when image is displayed it takes too much space. It looks too big. Is any way to restrict this?
Posted
Updated 14-May-11 13:55pm
v3
Comments
HimanshuJoshi 14-May-11 19:56pm    
Edited to improve the subject line and grammar.

This[^] article explains how to resize image.
 
Share this answer
 
Comments
Kim Togo 15-May-11 1:09am    
Good link. OP has the answer.
HimanshuJoshi 15-May-11 14:10pm    
Thank you!
Sergey Alexandrovich Kryukov 15-May-11 1:45am    
Agree, my 5.
--SA
HimanshuJoshi 15-May-11 14:10pm    
Thanks.
the easiest function to resize the image is :

Visual Basic .Net
VB
Private Function ResizeImage(Image As Image, NewSize As Size) As Image
     Return New Bitmap(Image, NewSize)
End Function



C# .Net
C#
Image ResizeImage(Image img, Size NewSize)
{
    return new Bitmap(img, NewSize );
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900