如何让TImage的Canvas在绘图时不产生闪烁感?

snowfog 2004-09-02 01:13:41
我在程序中会在一秒钟内调用多次LineTo方法,界面上会有闪烁感,如何让TImage的Canvas在绘图时不产生闪烁感?
...全文
272 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
点燃你的火花 2005-02-19
  • 打赏
  • 举报
回复
支持 doublebuffered := true;
我的image1放在scrollbox上,所以我在form的oncreate里写ScrollBox1.DoubleBuffered := true;
即使不锁定,重画整个image都不闪烁。
czkun 2004-11-25
  • 打赏
  • 举报
回复
方法,还不错,up,支持
yinweixian 2004-09-03
  • 打赏
  • 举报
回复
self.DoubleBuffered:= true;
慢点就慢点了
beyondtkl 2004-09-03
  • 打赏
  • 举报
回复
sailxia(小帆) :用TBitmap怎么在内存中画?给个例子吧

// 这也是一种常用的方法 先在内存中创建一个BITMAP 但是不显示 他只用来重画 即满足你的LineTo 然后用 BitBlt
The BitBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.

BOOL BitBlt(
HDC hdcDest, // handle to destination device context
int nXDest, // x-coordinate of destination rectangle's upper-left
// corner
int nYDest, // y-coordinate of destination rectangle's upper-left
// corner
int nWidth, // width of destination rectangle
int nHeight, // height of destination rectangle
HDC hdcSrc, // handle to source device context
int nXSrc, // x-coordinate of source rectangle's upper-left
// corner
int nYSrc, // y-coordinate of source rectangle's upper-left
// corner
DWORD dwRop // raster operation code
);

这个函数进行COPY.. 这样是从内存到内存的COPY 相对来说效果不错
wywry 2004-09-03
  • 打赏
  • 举报
回复
使用ImageEn控件
rcaicc 2004-09-03
  • 打赏
  • 举报
回复
image1.picture.bitmap:=tbitmap.creat;
.....
就是先建一个bitmap。
我是新手,不知道对不对。
snowfog 2004-09-02
  • 打赏
  • 举报
回复
sailxia(小帆) :用TBitmap怎么在内存中画?给个例子吧
荣爵 2004-09-02
  • 打赏
  • 举报
回复
也只能是這樣囉~~
snowfog 2004-09-02
  • 打赏
  • 举报
回复
双缓冲可以,但整体速度有点下降,有没有好办法提高速度?
Frank.WU 2004-09-02
  • 打赏
  • 举报
回复
最好是用TBitmap在內存中畫,然後使用BitBlt貼到Image上,這樣就不會閃了.
感謝miky教會我使用的這個方法!
2312 2004-09-02
  • 打赏
  • 举报
回复
设置doublebufferd ,
比如image放在panel上,就这样:

panel.doublebufferd := True;
楚人无衣 2004-09-02
  • 打赏
  • 举报
回复
开启屏幕双缓冲试试:OnCreate中写入self.DoubleBuffered:= true;
beyondtkl 2004-09-02
  • 打赏
  • 举报
回复
1. doublebufferd := True;
2. 画之前 把其他不需要重画的客户区锁定
画完后 解除锁定

LockWindowUpdate(theHandle); // 锁定
LockWindowUpdate(0); // 接触锁定

试试

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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