我是用timer来改变坐标的,也就是说在每次timer1_Tick事件中改变了变量值,然后调用的draw private void draw(Color cColor, int iX, int iY, int iWidth, int iHeight)
{
Color cTemp;
if (cColor == Color.White)
cTemp = Color.Black;
else
cTemp = Color.White; Graphics myGraphics = this.CreateGraphics();
myGraphics.Clear(cTemp);
myGraphics.SmoothingMode = SmoothingMode.HighQuality; myGraphics.FillEllipse(new SolidBrush(cColor), iX, iY, iWidth, iHeight);
myGraphics.CopyFromScreen(0, 0, 0, 0, new Size(this.Width, this.Height));//这是在MSDN上看到的解决闪烁的方法,但是我加上后只能缓解闪烁,但还是要闪
}
我把窗体的DoubleBuffered属性设置为True
上面这段代码需要怎么写才能解决闪烁的问题?
{
Color cTemp;
if (cColor == Color.White)
cTemp = Color.Black;
else
cTemp = Color.White; Graphics myGraphics = this.CreateGraphics();
myGraphics.Clear(cTemp);
myGraphics.SmoothingMode = SmoothingMode.HighQuality; myGraphics.FillEllipse(new SolidBrush(cColor), iX, iY, iWidth, iHeight);
myGraphics.CopyFromScreen(0, 0, 0, 0, new Size(this.Width, this.Height));//这是在MSDN上看到的解决闪烁的方法,但是我加上后只能缓解闪烁,但还是要闪
}
我把窗体的DoubleBuffered属性设置为True
上面这段代码需要怎么写才能解决闪烁的问题?
解决方案 »
- 如何获得操作系统是否64位
- 后台如何设置css?
- 截取字符串的问题
- 如何捕捉到一个数据转换的错误
- 提示“Newline in constant”是什么问题
- 关于读取数据库内容的一个简单问题
- sql server在xp sp2中无法被.net程序访问!报错说没有sql服务器,或者访问被拒绝!
- 请问如何动态生成控件数组
- 想做个 数据库插入记录后 桌面上弹出一个像QQ提示框
- 我做控件时某个属性内容可能是固定的几个,像是TextBox中的TextAlign属性只有Left/Right等属性。我怎样才能把固定的这几个值在控件属性栏
- vs2005 中,能用C#开发web程序吗?
- 两个xml简单问题解答一下,谢谢~
private void draw(Graphics myGraphics, Color cColor, int iX, int iY, int iWidth, int iHeight)
{
Color cTemp;
if (cColor == Color.White)
cTemp = Color.Black;
else
cTemp = Color.White; //Graphics myGraphics = this.CreateGraphics();
myGraphics.Clear(cTemp);
myGraphics.SmoothingMode = SmoothingMode.HighQuality; myGraphics.FillEllipse(new SolidBrush(cColor), iX, iY, iWidth, iHeight);
//myGraphics.CopyFromScreen(0, 0, 0, 0, new Size(this.Width, this.Height));//这是在MSDN上看到的解决闪烁的方法,但是我加上后只能缓解闪烁,但还是要闪
}
顺便再问一下,如何结贴?4、如何给帖子结帖,结帖如何给分? 点击帖子左上方的管理帖子,可以进行“无满意结帖”;单独给分结帖;平均给分结帖。 注:结帖人不允许给自己的回复得分;
我点管理帖子后,没有 单独给分结帖;平均给分结帖 这两个DD
到底是怎么回事哦?