By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,457 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,457 IT Pros & Developers. It's quick & easy.

Image size

P: n/a
How do you resize an image object? The Size property is read-only.
Jon Cosby
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jon Cosby" <jc****@nospam.net> wrote in message
news:wo*****************@newsread2.news.pas.earthl ink.net...
How do you resize an image object? The Size property is read-only.
Jon Cosby

Nov 16 '05 #2

P: n/a
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

"Jon Cosby" <jc****@nospam.net> wrote in message
news:wo*****************@newsread2.news.pas.earthl ink.net...
How do you resize an image object? The Size property is read-only.
Jon Cosby

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.