paint事件的触发问题

xandercheng 2010-12-10 07:50:38
谁能给我个自定义paint类
现状:
频繁触发Paint事件,频繁画图,程序效率不高
...全文
90 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
whrspsoft3723 2010-12-10
  • 打赏
  • 举报
回复
参考下一楼写法。
onpaint在 属性窗口中找“事件”
xandercheng 2010-12-10
  • 打赏
  • 举报
回复
onpaint在什么地方
whrspsoft3723 2010-12-10
  • 打赏
  • 举报
回复
在onpaint() 中画图就行了,如果嫌效率不高,用双缓 冲绘图。 可以满足 你的要求。

Bitmap bmp = new Bitmap(width,height);
Graphics g = Graphics.CreateGraphics();
g.drawline(Pen.Black,0,0,0,0);
...

e.Graphics.DrawImageUn...();(名称忘记了,画到e.Graphics)就行了


wuyq11 2010-12-10
  • 打赏
  • 举报
回复
this.SuspendLayout();
//画...

this.ResumeLayout(false);
this.PerformLayout();

private void Form1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.Clear(this.BackColor);

}

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧