Image size

  • Thread starter Thread starter Jon Cosby
  • Start date Start date
Jon,

In order to do this, you will have to create a new Image object (or
rather, a class that derives from it, since Image is an abstract class),
with the size that you wish it to be. Then, you will have to get the
Graphics instance for that image, and call the DrawImage method on that,
specifiying the original image, and the scaling options you want to apply.

Hope this helps.
 
There are couple of ways to resize image

Method 1

Put your image into the PictureBox Control. PictureBox has a property
SizeMode, where you can resize the fashion you want

Method 2.

Create a Bitmap Object and place the image with new co-ordinates

example -

//create new image
Image TestImage = Image.FromFile (blah blah)

//define new resize size
Size newSize = new Size(400,400)

//display the image with new size
Bitmap newBmp = new Bitmap(TestImage,newSize.width, newSize.height)

Shak
 
Back
Top