using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

 

namespace BYS2012

{

    public partial class Form6 : Form

    {

        public Form6()

        {

            InitializeComponent();

        }

 

        private void button1_Click(object sender, EventArgs e)

        {

           

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

                Bitmap myBitmap = new Bitmap("D:\\pqimg\\" + "IMG_2537.jpg");

                int y = (int)1440 * myBitmap.Height / myBitmap.Width;

 

                Image myThumbnail = myBitmap.GetThumbnailImage(1440,y, myCallback, IntPtr.Zero);

                myThumbnail.Save("D:\\pqimg2\\" + "IMG_2537.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);

 

                MessageBox.Show("ok");

           

        }

        public bool ThumbnailCallback()

        {

            return false;

        }

    }

}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2021-07-30
  • 2022-12-23
  • 2021-11-09
  • 2021-05-20
猜你喜欢
  • 2021-09-21
  • 2021-12-13
  • 2021-07-20
相关资源
相似解决方案