日期:2014-05-18  浏览次数:20915 次

pictureBox显示问题
请问 Bitmap myBitmap = new Bitmap(apfPath);
  Graphics g = pBShowPicture.CreateGraphics();
  //放大 
  Rectangle expansionRectangle = new Rectangle(400, 10, myBitmap.Width * 2, myBitmap.Height * 2);
  g.DrawImage(myBitmap, expansionRectangle);


这些代码怎么不管用,是不是我没把绘完的图显示在pictureBox中, 如何显示? 谢谢。

------解决方案--------------------
Bitmap myBitmap = new Bitmap(@"C:\Users\SaeWind\Desktop\123\1.png");
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{

Graphics g = e.Graphics;
//放大
Rectangle expansionRectangle = new Rectangle(10, 10, myBitmap.Width * 2, myBitmap.Height * 2);
g.DrawImage(myBitmap, expansionRectangle);

}