Ejemplo n.º 1
0
 public static System.IO.Stream Crop(System.IO.Stream inputStream, Rectangle cropArea, int descWidth, int descHeight)
 {
     ImageProcessor imageProcessor = new ImageProcessor();
     CropFilter item = new CropFilter(cropArea, descWidth, descHeight);
     imageProcessor.Filters.Add(item);
     return imageProcessor.Process(inputStream);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 裁剪图像
        /// </summary>
        /// <param name="inputStream">图像文件流</param>
        /// <param name="cropArea">原图待裁剪的矩形选区</param>
        /// <param name="descWidth">裁剪后图像的宽度</param>
        /// <param name="descHeight">裁剪后图像的高度</param>
        /// <returns>返回裁剪后的图像文件流</returns>
        public static Stream Crop(Stream inputStream, Rectangle cropArea, int descWidth, int descHeight)
        {
            ImageProcessor imageProcessor = new ImageProcessor();
            CropFilter     cropFilter     = new CropFilter(cropArea, descWidth, descHeight);

            imageProcessor.Filters.Add(cropFilter);
            return(imageProcessor.Process(inputStream));
        }