private Bitmap MyImage ;
public void ShowMyImage(String fileToDisplay, int xSize, int ySize)
{
// Sets up an image object to be displayed.
if (MyImage != null)
{
MyImage.Dispose();
} // Stretches the image to fit the pictureBox.
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage ;
MyImage = new Bitmap(@"C:\my.bmp");
pictureBox1.ClientSize = new Size(xSize, ySize);
pictureBox1.Image = (Image) MyImage ;
}
public void ShowMyImage(String fileToDisplay, int xSize, int ySize)
{
// Sets up an image object to be displayed.
if (MyImage != null)
{
MyImage.Dispose();
} // Stretches the image to fit the pictureBox.
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage ;
MyImage = new Bitmap(@"C:\my.bmp");
pictureBox1.ClientSize = new Size(xSize, ySize);
pictureBox1.Image = (Image) MyImage ;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货