I guess that the mentioned textboxes determine the desired width and height of the resulting image. If that's the case, you can replace them with
NumericUpDowns. Their benefit is that you are guaranteed to get a
Value of
Decimal type without needing to parse input. A simple boundary check suffices.
Create a new image object using the dimensions you got, get a
Graphics object from it and use that to draw the original image. It will result in being drawn onto the new image with new size:
System.Drawing.Image Resize(System.Drawing.Image sourceImage, int targetWidt, int targetHeight)
{
System.Drawing.Image targetImage = new System.Drawing.Bitmap(targetWidt, targetHeight);
System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(targetImage);
graphics.DrawImage(sourceImage, 0, 0, targetWidt, targetHeight);
return (targetImage);
}