示例#1
0
        public void Contrast(ProcessedImage image, int value)
        {
            var i = image.Image;

            using (MemoryStream inStream = new MemoryStream())
            {
                i.Save(inStream, image.ImageFormat);
                inStream.Position = 0;
                using (var imageFactory = new ImageFactory(preserveExifData: false))
                {
                    imageFactory.Load(inStream)
                    .Contrast(value)
                    .Save(inStream);
                }
                image.Image = new Bitmap(Image.FromStream(inStream));
            }
        }
示例#2
0
        public void Resize(ProcessedImage image, Size newSize)
        {
            var i = image.Image;
            var r = new ResizeLayer(newSize, ResizeMode.Crop);

            using (MemoryStream inStream = new MemoryStream())
            {
                i.Save(inStream, image.ImageFormat);
                inStream.Position = 0;
                using (var imageFactory = new ImageFactory(preserveExifData: false))
                {
                    imageFactory.Load(inStream)
                    .Resize(r)
                    .Save(inStream);
                }
                image.Image = new Bitmap(Image.FromStream(inStream));
            }
        }
示例#3
0
 public void Add(ProcessedImage image) => Images.Add(image);