コード例 #1
0
        /// <summary>
        /// Processes the filter.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The args.</param>
        public override void ProcessFilter(object sender, DownloadFilterArgs args)
        {
            Image img = Image.FromStream(args.FilteredStream);

            if (img.RawFormat.Guid == ImageFormat.Jpeg.Guid ||
                img.RawFormat.Guid == ImageFormat.MemoryBmp.Guid)
            {
                MemoryStream stream    = new MemoryStream();
                Image        thumbnail = img.GetThumbnailImage(width, height, null, IntPtr.Zero);
                thumbnail.Save(stream, ImageFormat.Jpeg);

                args.FilteredStream       = stream;
                args.BlobInfo.ContentSize = stream.Length;
            }
        }
コード例 #2
0
 /// <summary>
 /// Processes the filter.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The args.</param>
 public abstract void ProcessFilter(object sender, DownloadFilterArgs args);