赛迪网 > IT技术 编程语言 > 文章
  IT资讯搜索
 
IT产品搜索
[程序开发][网管世界][网络安全][数据库技术]
[操作系统][嘉宾聊天·在线访谈][活动集锦]
[精彩专题][Symantec专区][订阅IT技术周刊]
[开发论坛][网管论坛][安全论坛][数据库论坛]
[操作系统论坛][Sybase专区][IBM dW技术专区]
[病毒求助][病毒与漏洞播报][文档·源码下载]

怎样让移动图像显示更快一些...

发布时间:2006.08.16 02:46     来源:plwww    作者:

                           ***怎样让移动图像显示更快一些***

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 IntegersHeight = ScaleHeight / 4For i = 0 To 3lstDisplay(i).Move 0, i * sHeight, _ScaleWidth, sHeightNextEnd Sub

This 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 IntegerpicContainer.Visible = FalsepicContainer.Move 0, 0, ScaleWidth, ScaleHeightsHeight = ScaleHeight / 4For i = 0 To 3lstDisplay(i).Move 0, i * sHeight, _ScaleWidth, sHeightNextpicContainer.Visible = TrueEnd Sub

Note 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.


[ 发表评论 ] 字体[  ] [ 打印 ] [ 进入博客 ] [ 进入论坛 ]  [ 推荐给朋友 ]
  相关文章
· 实现无标题栏拖动 (05-24) · AutoRedraw属性与窗体设备场景的深入探讨 (11-21)
· 在VB中调用Windows API的注意事项 (02-02) · --==vb6中用图片框任意大小播放AVI电影(New (10-14)
· XML 简单接口 (SAX2)用Visual Basic 实现的 (09-11) · --=== 让你的程序开始说话(在VB中使用文字朗 (10-27)
· --=== 利用微软网格控件进行编辑输入==-- (10-13) · VB 实现大文件的分割与恢复,引用 ADODB.Strea (12-06)
· 一段精简的使用 ADODB.Stream 读写大字段的 V (05-01) · 一种调用Win95 API实现串行通信的查询方法 (09-28)
  客户需求反馈表
* 姓  名:
更多资料  了解方案  认识厂商
* 单位名称:
* 联系电话:
* 电子邮件:
  赛迪推荐  
  手机·资费 ·新品·导购·评测·手机资费·宽带
手机搜索  诺基亚 N73 MOTO Z6
  IT产品 ·笔记本·台式机·服务器·打印·投影
IT产品搜索 
  IT技术 ·开发·网管·安全·数据库·操作系统
  信息化 ·热点·专题·访谈·周刊·方案案例
[政务][电信][金融][农业][制造业][中小企业]
[CIO][ERP][协同][IT管理][中间件][电子商务]
[政策][地方][专家][评估][辞典][博客][社区]
· 专题:一路畅通构想曲——让出行不再遭遇堵车
· CIO工作亲历:企业ERP选型不能忽视"选人关"
· 综述:信息化建设给中国监狱带来的各种变化
· 金融业风险管理和法规遵从有五点需考虑的因素
· 保险业CIO关注:该如何建立统一高效的CRM体系
· 调查显示:多数CIO对IT规划仍存在困惑和误解
  博客·论坛 ·曾剑秋·项立刚·Java学习·网管