Click here to Skip to main content
15,890,982 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have an web application in c#.It is having an image folder. I want to re size those images dynamically depends up on the request.(some times it is 180* 180 or 566 * 566 etc) and show in a "img" control no need to save anywhere.Only for display .

Thank You
Posted
Updated 29-Sep-15 22:24pm
v2
Comments
So where is the issue?
sijila 21-Sep-15 8:17am    
how to do

1 solution

I assume you are doing this to show a thumbnail or similar?
If so, then personally, I'd create a folder called "thumbnails" and save a thumbn to that, cross referencing the thumb to the full image - that way you only do it once.

But...either way, the Image class has a GetThumbnailImage method[^] which does exactly that - creates a thumbnail image from a full image without using an intermediary file.
 
Share this answer
 
Comments
sijila 21-Sep-15 2:18am    
i don't need to save those images in folder.just resize and show in the control.
OriginalGriff 21-Sep-15 2:37am    
You may not need to, but it's probably a good idea. If you are going to display the image more than once, then saving the thumb in a file means less processing time fitfor the second and subsequent displays. Since resizing images is not a trivial operation, this can mean a considerable improvement in response times from your web server.
sijila 21-Sep-15 2:46am    
Actually more than 200 images are there.and it is a growing folder too. duplication of the that much image .So i thought something like this
Ralf Meier 30-Sep-15 6:36am    
You can follow the Suggestion from OG (for me it sounds good) or you could save the wanted size-settings (for each Image you have).

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