-1

我有这个代码:

public static Bitmap ResizeImage(Bitmap imgToResize, Size size)
        {
            try
            {
                Bitmap b = new Bitmap(size.Width, size.Height);
                using (Graphics g = Graphics.FromImage((Image)b))
                {
                    g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;

                    g.DrawImage(imgToResize, 0, 0, size.Width, size.Height);
                }

                return b;
            }
            catch
            {
                throw;
            }
        }

例如,当我调用该函数时: ResizeImage(bmp, 如何设置大小?

4

1 回答 1

1

例如:

ResizeImage(bmp, new Size(150, 150));
于 2013-05-13T20:27:37.443 回答