Posted on: 6/9/2013 9:59:16 AM | Views : 363

I am resizing image using bitmap.
Now, the problem is that whenevr i am resizing, its size is icreased.
For i.e. Image size is 100 KB, im making image small so after resizing its size increases to more than 100 KB. My main target is to decrease image size so im resizing but.
How to solve this problem ?
My code is as below :
// Save image in Small size... System.Drawing.Image imageToBeResized = System.Drawing.Image.FromStream(fuProjectImages.PostedFile.InputStream); int imageHeight = imageToBeResized.Height; int imageWidth = imageToBeResized.Width; int maxHeight = 120; int maxWidth = 160; imageHeight = (imageHeight * maxWidth) / imageWidth; imageWidth = maxWidth; if (imageHeight > maxHeight) { imageWidth = (imageWidth * maxHeight) / imageHeight; imageHeight = maxHeight; } Bitmap bitmap = new Bitmap(imageToBeResized, imageWidth, imageHeight); bitmap.Save(Ser ...

Go to the complete details ...