Sample Program for Image Processing in C# Using ASP .
NET
//Tool->Nuget Pakage Manager-> Console: PM> Install-Package ImageProcessor
using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using ImageProcessor;
using [Link];
using [Link];
namespace ASPNETImageProcessing
{
class Program
{
static void Main(string[] args)
{
//byte[] photoBytes = [Link]("Apollo11_Launch7.png");
byte[] photoBytes = [Link]("[Link]");
// Format is automatically detected though can be changed.
ISupportedImageFormat format = new JpegFormat { Quality = 70 };
Size size = new Size(300, 0);
using (MemoryStream inStream = new MemoryStream(photoBytes))
{
using (MemoryStream outStream = new MemoryStream())
{
// Initialize the ImageFactory using the overload to preserve EXIF
metadata.
using (ImageFactory imageFactory = new ImageFactory(preserveExifData:
true))
{
// Load, resize, set the format and quality and save an image.
[Link](inStream)
.Rotate(90)
.Resize(size)
.Format(format)
.Save(outStream);
}
// Do something with the stream.
using (FileStream file = new FileStream "[Link]",
[Link], [Link]))
{
[Link](file);
}
}
}
}
CIS 465 Multimedia Sunnie Chung
}
}
Input File: "[Link]"
CIS 465 Multimedia Sunnie Chung
Output file: [Link]
CIS 465 Multimedia Sunnie Chung