CaptchaRecogition.ImageProcess.Normalized C# (CSharp) Метод

Normalized() публичный статический Метод

把图片的宽高统一,归一
public static Normalized ( Bitmap bitmap, int ww, int hh ) : Bitmap
bitmap System.Drawing.Bitmap 需要处理的图片
ww int
hh int
Результат System.Drawing.Bitmap
        public static Bitmap Normalized(Bitmap bitmap, int ww, int hh)
        {
            Bitmap temp = new Bitmap(ww, hh);
            Graphics myGraphics = Graphics.FromImage(temp);
            //源图像中要裁切的区域
            Rectangle sourceRectangle = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
            ////缩小后要绘制的区域
            Rectangle destRectangle = new Rectangle(0, 0, ww, hh);
            myGraphics.Clear(Color.White);
            ////绘制缩小的图像
            myGraphics.DrawImage(bitmap, destRectangle, sourceRectangle, GraphicsUnit.Pixel);
            myGraphics.Dispose();
            return temp;
        }
        /// <summary>