public bool ThumbnailCallback()
        {
            return false;
        }

Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(ThumbnailCallback);

                  Image myThumbnailPicture;

                    Image imageFile = Image.FromFile(strPath);

                    int newWidth, newHeight;
                   
                    newWidth = 400;
                    newHeight = (int)((float)newWidth * imageFile.Height / imageFile.Width);
                       
                    Bitmap myBitmap = new Bitmap(imageFile);
                    Image myThumbnail = myBitmap.GetThumbnailImage(newWidth, newHeight, myCallback, IntPtr.Zero);


                    string strTempPicture = "ThumbnailImage.jpg";
                    myThumbnail.Save(strTempPicture, ImageFormat.Jpeg);

相关文章:

  • 2022-02-19
  • 2021-07-09
  • 2021-08-28
  • 2021-08-19
  • 2022-12-23
  • 2020-02-04
  • 2021-11-25
猜你喜欢
  • 2021-07-07
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2021-08-09
相关资源
相似解决方案