把 doubolebuffered设置为ture时图片就无法显示。只有当窗体被系统重绘的时候才能看到bitmap图片
下面是OnPaint函数
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
Graphics graphics = Graphics.FromHwnd(this.Handle);
graphics.DrawImageUnscaled(bitmap, x, y);//bitmap是一个位图
}
而doubolebuffered设置为false时图片可以正常显示,不过会闪烁。所以想用双缓存。
高手指点一下……
下面是OnPaint函数
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
Graphics graphics = Graphics.FromHwnd(this.Handle);
graphics.DrawImageUnscaled(bitmap, x, y);//bitmap是一个位图
}
而doubolebuffered设置为false时图片可以正常显示,不过会闪烁。所以想用双缓存。
高手指点一下……
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.ResizeRedraw ¦ ControlStyles.Opaque, true);更不行,连我的背景都没了!
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
e.Graphics.DrawImageUnscaled(bitmap, x, y);//bitmap是一个位图
}
--------
现在确实太少了。都不来了。