In this article I am showing an Image resize control that can be used in share point. This will be use full if you are loading an image from share point picture library and showing in a web part. This will help you to automatically resize the image with proportional height and width.
- First step is to place the ThumbImage.aspx and ThumbImage.aspx.cs file in _layout folder of share point. I have attached the code file for both please have a look at the code.

- As the web part accessing the images from picture library you have to give the network credentials to view the images for normal users (I am using anonymous access in the web application, if you are not using you can avoid passing network credentials).
- Where you want to resize the image call the below
imgLogo.Src = @"/_layouts//ThumbImage.aspx?img=" + item["Image _Logo"].ToString().Substring(0, item["Image _Logo "].ToString().IndexOf(","));
- Where Image _Logo contains the URL of the image.

vijay kishanPosted Mar 17, 2012, 5:56 AM
Hi , I have kept the code in layouts folder. How it will be called. My reqt is whenever a pic is added to a pic lib it should be resized.
Alexey ShlibanovPosted Dec 4, 2011, 9:27 AM
Hello, often, there is a need to resize and/or compress images automatically when them are uploaded to SharePoint. Here is a nice article with an example of such a workflow: http://www.harepoint.com/Products/HarePointWorkflowExtensions/Example-Images.aspx Thanks.
caleb hurPosted Mar 2, 2011, 5:05 PM
When I download the code.zip, I get a zip file with one text file called "flash code.txt" that is unrelevant to this. Can you upload it again? Thanks.
John SamueleditedPosted Nov 2, 2010, 12:19 PMEdited Nov 2, 2010, 12:19 PM
I was searching for a image resize control for sharepoint.My requirement is also some what similar.Instead of placing the aspx file in _layout can i place the aspx file in control template ?