1
using C# coding system.drawing
1
Hi Prabha,
Can you please let's clear where you are trying to update this images, if it sharePoint we ca do using image renditions sharepoint.
We will waiting for your update.
Thanks
0
If you are uploading images from client side to server side (.NET C# or VB.NET code), the following forum post shows how you can resize or scale the image to a smaller size using native C# .NET classes:
https://stackoverflow.com/questions/6501797/resize-image-proportionally-with-maxheight-and-maxwidth-constraintsBut if you are looking for more professional functions to resize the image and keep the quality and image data (such as DPI, TAGS, etc.), you can try using the .NET SizeCommand class from LEADTOOLS as shown in the following link:
https://www.leadtools.com/help/leadtools/v19/dh/l/imageprocessing-resizecommand.htmlAfter resizing it, you can save it using the same original image's format and bits per pixel; and convert it to any other supported format.
The following code shows how you can load the image from stream, resize it and then save it to a different format using LEADTOOLS:
-
-
-
- RasterCodecs codecs = new RasterCodecs();
-
- RasterImage image = codecs.Load(srcFileStream);
-
- SizeCommand command = new SizeCommand();
- command.Width = 800;
- command.Height = 600;
- command.Flags = RasterSizeFlags.Resample;
- command.Run(image);
-
-
- codecs.Save(image, destFileName, RasterImageFormat.Png, 24);
-
- image.Dispose();
- codecs.Dispose();
