GetThumbnailImage 缩放图像会严重失真

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;

        }

    }

}

原文地址:https://www.cnblogs.com/qqhfeng/p/3125745.html