Beispiel #1
0
 public static void MakeThumbnailImage(
     string fileName,
     string newFileName,
     int maxWidth,
     int maxHeight)
 {
     Thumbnail.MakeThumbnailImage(Image.FromStream((Stream) new MemoryStream(System.IO.File.ReadAllBytes(fileName))), newFileName, maxWidth, maxHeight);
 }
Beispiel #2
0
        public static void MakeRemoteThumbnailImage(
            string url,
            string newFileName,
            int maxWidth,
            int maxHeight)
        {
            Stream remoteImage = Thumbnail.GetRemoteImage(url);

            if (remoteImage == null)
            {
                return;
            }
            Image original = Image.FromStream(remoteImage);

            remoteImage.Close();
            Thumbnail.MakeThumbnailImage(original, newFileName, maxWidth, maxHeight);
        }