c# winform中 Form_paint事件绘制的图片怎么转换为窗体背景,避免重绘时闪烁
总是调用Form_paint事件,出现严重闪烁,用双重缓没改变!看看这样行不行的通?帮帮忙Graphicsg=this.CreateGraphics();//创建绘图对象...
总是调用Form_paint事件,出现严重闪烁,用双重缓没改变!看看这样行不行的通?帮帮忙
Graphics g = this.CreateGraphics();//创建绘图对象
Pen a = new Pen(Color.Chocolate, 2);
int jc = 51, jc1 = 25;
int jc4 = 301, jc3 = 25;
for (int ww = 0; ww <= 4; ww++)//画上家的横线
{
g.DrawLine(a, 25, jc, 425, jc);
jc += 50;
}
for (int ee = 0; ee <= 8; ee++)//画上家的纵线
{
g.DrawLine(a, jc1, 51, jc1, 250);
jc1 += 50;
}
for (int ww1 = 0; ww1 <= 4; ww1++)
{
g.DrawLine(a, 25, jc4, 425, jc4);
jc4 += 50;
}
for (int ee = 0; ee <= 8; ee++)
{
g.DrawLine(a, jc3, 301, jc3, 501);
jc3 += 50;
}
a.Dispose();
g.Dispose();
移动下棋子出现严重重绘 ,是FORM_paint里面的 展开
Graphics g = this.CreateGraphics();//创建绘图对象
Pen a = new Pen(Color.Chocolate, 2);
int jc = 51, jc1 = 25;
int jc4 = 301, jc3 = 25;
for (int ww = 0; ww <= 4; ww++)//画上家的横线
{
g.DrawLine(a, 25, jc, 425, jc);
jc += 50;
}
for (int ee = 0; ee <= 8; ee++)//画上家的纵线
{
g.DrawLine(a, jc1, 51, jc1, 250);
jc1 += 50;
}
for (int ww1 = 0; ww1 <= 4; ww1++)
{
g.DrawLine(a, 25, jc4, 425, jc4);
jc4 += 50;
}
for (int ee = 0; ee <= 8; ee++)
{
g.DrawLine(a, jc3, 301, jc3, 501);
jc3 += 50;
}
a.Dispose();
g.Dispose();
移动下棋子出现严重重绘 ,是FORM_paint里面的 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询