how can i a image

Ð

ÐìÇä

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
 
P

Peter Jausovec

Hi,

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top