Question

I am working a mvc web app. I upload a image to use it as system logo. Now if I select image and upload it, it can be replaced easily until image file is not of large dimesion. For file with large dimension i need to reduce its size to some smaller size to make it look like a system logo. Preferable size for my logo is 100x75. How can I reduce the file dimesion? THanks, kapil

Was it helpful?

Solution

You can use the classes that are in the System.Drawing namespace.

See this tutorial for details.

OTHER TIPS

try this. I found it in the msdn, and it works.

Bitmap map = new Bitmap(Image.FromFile("F:\\1.jpg"), new Size(20, 20));
map.Save("F:\\5.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top