resize image in asp.net
-
Hi how to resize image in asp.net. thanks
You get the best out of others when you give the best of yourself.
-
Hi how to resize image in asp.net. thanks
You get the best out of others when you give the best of yourself.
-
Hi how to resize image in asp.net. thanks
You get the best out of others when you give the best of yourself.
1- If you want to resize the image just for display then you can set the width and height of the image as required. 2- If you want it be interactive, so that client can resize the image then I will prefer some jquery plugin to do this task. Check this out http://plugins.jquery.com/taxonomy/term/2532[^] 3- If you want to do this at server side then using the GDI+ you can resize the image. Check this Resizing a Photographic image with GDI+ for .NET[^]
Regards, Prakash Kalakoti
-
1- If you want to resize the image just for display then you can set the width and height of the image as required. 2- If you want it be interactive, so that client can resize the image then I will prefer some jquery plugin to do this task. Check this out http://plugins.jquery.com/taxonomy/term/2532[^] 3- If you want to do this at server side then using the GDI+ you can resize the image. Check this Resizing a Photographic image with GDI+ for .NET[^]
Regards, Prakash Kalakoti
I need to resize and want to save in disc so pixel quality will be maintained. thanks
You get the best out of others when you give the best of yourself.
-
I need to resize and want to save in disc so pixel quality will be maintained. thanks
You get the best out of others when you give the best of yourself.
-
Then explore the 3rd option, you will find some example in the article which scales the image by fixed size of percentage.
Regards, Prakash Kalakoti
It's resizing image but no quality in image like in 800*600 dimension. thanks
You get the best out of others when you give the best of yourself.
-
Hi how to resize image in asp.net. thanks
You get the best out of others when you give the best of yourself.
This Function Can help you! :-D
Public Function ResizePicture(ByVal sourceImage As Bitmap, ByVal newSize As Size) As Bitmap Dim Result\_image As New Bitmap(sourceImage, newSize.Width, newSize.Height) Dim Gr As Graphics Gr = Graphics.FromImage(Result\_image) Gr.DrawImage(Result\_image, 0, 0, newSize.Width, newSize.Height) Gr.Save() Return Result\_image End Function
Then you can save the output of this Function By using
ResizePicture(MyBitmap, New Size(100, 100)).Save(MapPath("/") & "/Images/MyImage.png", Imaging.ImageFormat.Png)
Note: These codes are in VB.NET Language, but you can simply convert it to C# or any .NET languageRegards. Mehdi Ghiasi