how can i a image

  • Thread starter Thread starter ÐìÇä
  • Start date Start date
Ð

ÐìÇä

hi
i'm a newer to c#,
how can i stretch a image when i resize the form

Image image=Image.FromFile("c:\1.jpg");

public override OnPoint(PaintEventArgs e)
{
e.Graphics.DrawImage(image,new
Rectangle(0,0,this.Size.Width,this.Size.Height),
new
Rectangle(0,0,image.Width,image.Height),GraphicsUnit.Pixel);
}


thank lots
 
Hi,

Why don't you use PictureBox, set the dock property to fill and SizeMode to
StrechImage.
 
Back
Top