我制作了一个组件,上有一个TImage控件,当程序运行时,可以拖动TImage控件。可是在实际应用中,我发现当TImage控件移动时,系统重绘该组件(继承自TPanel),会产生明显的闪烁。请问各位高手怎样解决这个问题。
解决方案 »
- webbrowser控件问题
- 为什么每次启动DELPHI后只会出现一次错误?
- 什么grid组件能在网格上显示图片的?
- [求助]CSDN的雅虎邮箱里面关于POP3和SMTP的设置是什么?
- ~~~weizi2000(秋风啊) 进~~~~送分~~(2)~~
- 急!在线等待!
- 怎样对一个自动化实例编译、链连、运行(相单简单,但我没有用过)
- 请教高手FastReport4中打印外部图片的问题
- TRect是什么类型的变量。
- 有的属性后有两点,VCL中怎找不到处理源码??如DCOMConnection弹出网域计算机名选择框
- 很奇怪的问题百思不得其解!'Printer selected is not valid.'
- 怎么样把Access数据转换成paradox类型数据啊???Delphi自带的工具行不行啊?
可是,我的组件是继承自TGraphicControl,怎么处理?
Image.Stretch:=True;
Image.Transparent:=False;至于原因,查看VCLprocedure TImage.PictureChanged(Sender: TObject);
var
G: TGraphic;
begin
if AutoSize and (Picture.Width > 0) and (Picture.Height > 0) then
SetBounds(Left, Top, Picture.Width, Picture.Height);
G := Picture.Graphic;
if G <> nil then
begin
if not ((G is TMetaFile) or (G is TIcon)) then
G.Transparent := FTransparent;
if (not G.Transparent) and Stretch and not Proportional then
ControlStyle := ControlStyle + [csOpaque]
else // picture might not cover entire clientrect
ControlStyle := ControlStyle - [csOpaque];
if DoPaletteChange and FDrawing then Update;
end
else ControlStyle := ControlStyle - [csOpaque];
if not FDrawing then Invalidate;
end;就是改变ControlStyle!