怎样让移动图像显示更快一些...
2008-01-03 15:29
387 查看
***怎样让移动图像显示更快一些***
Hide Controls When Setting Properties to Avoid Multiple Repaints
Every repaint is expensive. The fewer repaints Visual Basic must perform, the faster your application will appear. One way to reduce the number of repaints is to make controls invisible while you are manipulating them. For example, suppose you want to resize several list boxes in the Resize event for the form:Sub Form_Resize ()Dim i As Integer, sHeight As Integer sHeight = ScaleHeight / 4 For i = 0 To 3 lstDisplay(i).Move 0, i * sHeight, _ ScaleWidth, sHeight NextEnd SubThis creates four separate repaints, one for each list box. You can reduce the number of repaints by placing all the list boxes within a picture box, and hiding the picture box before you move and size the list boxes. Then, when you make the picture box visible again, all of
the list boxes are painted in a single pass:
在vb中用move方法移动图片时,速度有些慢,当图片很大时,这时可以用下面的方法:
Sub Form_Resize ()Dim i As Integer, sHeight As Integer picContainer.Visible = False picContainer.Move 0, 0, ScaleWidth, ScaleHeight sHeight = ScaleHeight / 4 For i = 0 To 3 lstDisplay(i).Move 0, i * sHeight, _ ScaleWidth, sHeight Next picContainer.Visible = TrueEnd SubNote that this example uses the Move method instead of setting the Top and Left properties. The Move method sets both properties in a single operation, saving additional repaints.
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=5671
相关文章推荐
- 怎样让移动图像显示更快一些...
- 怎样让移动图像显示更快一些...
- 怎样让移动图像显示更快一些...
- 怎样让移动图像显示更快一些...
- j2me-显示、移动图像,移动文本
- MFC图像处理-图像移动显示算法
- 自己写的基于JavaScript DOM 仿一些页面的鼠标移动显示相应区块内容
- 自己写的基于JavaScript DOM 仿一些页面的鼠标移动显示相应区块内容
- 鼠标移动到图片上,图片显示阴影边框,其他一些样式积累
- 自己写的基于JavaScript DOM 仿一些页面的鼠标移动显示相应区块内容
- 自己写的基于JavaScript DOM 仿一些页面的鼠标移动显示相应区块内容
- vim怎样在被显示为多行的单行里象真正的多行移动
- (转)使用OpenGL显示图像(五)添加移动
- 怎样显示Jpg,bmp,Gif图像文件
- 自己写的基于JavaScript DOM 仿一些页面的鼠标移动显示相应区块内容
- seed-dvs6467 encodedecode实例 采集的图像质量很差,只有隔行显示,而且每帧图像不断的往下移动?
- 自己写的基于JavaScript DOM 仿一些页面的鼠标移动显示相应区块内容
- 左下角随机显示的漂浮图像,可以随滚动条上下移动
- MATLAB GUI 的一些小技巧(参数传递、结果显示、图像清除)
- 自己写的基于JavaScript DOM 仿一些页面的鼠标移动显示相应区块内容