-1

I have this code:

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;
            }
        }

When i call the function for example : ResizeImage(bmp, How do i set the size ?

Yaron Cohen Minz
  • 127
  • 3
  • 15

1 Answers1

1

in example:

ResizeImage(bmp, new Size(150, 150));
magmel
  • 590
  • 4
  • 14