private Image bgImage;
public FormBase()
{
bgImage= new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("CMclient.Image.Img_BackGround.gif"));
}
//绘制背景
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.DrawImage(bgImage, this.ClientRectangle, new Rectangle(0, 0, this.bgImage.Width, this.bgImage.Height), GraphicsUnit.Pixel);
}
public FormBase()
{
bgImage= new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("CMclient.Image.Img_BackGround.gif"));
}
//绘制背景
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.DrawImage(bgImage, this.ClientRectangle, new Rectangle(0, 0, this.bgImage.Width, this.bgImage.Height), GraphicsUnit.Pixel);
}