You can resize the image using the GetThumbnailImage method.
Here's more info:
http://msdn.microsoft.com/library/d...emDrawingImageClassGetThumbnailImageTopic.asp
Or maybe you'll find these custom functions useful that I wrote:
public Image DisplaySize(Bitmap bmp)
{
Response.Write(bmp.Width.ToString());
Response.Write(bmp.Height.ToString());
}
//shrink the image proportionately so that neither height nor width is more
than [NewSize] pixels
public System.Drawing.Image ShrinkImage(System.Drawing.Bitmap bmp, int
NewSize)
{
double NewWidth;
double NewHeight;
double ShrinkPercent;
System.Drawing.Image.GetThumbnailImageAbort myCallback =
new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);
if (bmp.Width>bmp.Height)
{
NewWidth=NewSize;
ShrinkPercent=(NewWidth/bmp.Width)*100;
NewHeight=(ShrinkPercent/100)*bmp.Height;
}
else
{
NewHeight=NewSize;
ShrinkPercent=(NewHeight/bmp.Height)*100;
NewWidth=(ShrinkPercent/100)*bmp.Width;
}
System.Drawing.Image myShrunkenImage =
bmp.GetThumbnailImage((int)NewWidth,(int)NewHeight,myCallback,IntPtr.Zero);
return myShrunkenImage;
}
public bool ThumbnailCallback(){return false;}