复现步骤:
- 在新的VCL表单中添加
TPanel
并设置Align = alClient
。 - 将
TSpeedButton
添加到面板中,并将一些bmp图像分配给Glyph
属性。(可选,但使其更清晰:Flat = True
) - 运行应用程序,抓住窗体的右下角并移动它。
TSpeedButton
中的图像会闪烁。
我阅读了很多关于消除闪烁的文章,但建议都似乎对TSpeedButton
无效:
- 没有
DoubleBuffered
属性 WS_EX_COMPOSITED
无法设置,因为它不是TWinControl
而是TGraphicControl
- 未收到
WM_ERASEBKGND
消息
如果这有任何重要性,请注意,我实际上正在使用TPngSpeedButton
,但由于实际问题在于TSpeedButton
,因此我在示例中使用它。
有没有任何解决方案?
编辑:出于某种原因,迄今为止没有人能够复现这个问题,因此为了确保不是我的描述有问题,这里是dfm:
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 337
ClientWidth = 635
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 0
Top = 0
Width = 635
Height = 337
Align = alClient
Caption = 'Panel1'
TabOrder = 0
object SpeedButton1: TSpeedButton
Left = 64
Top = 56
Width = 32
Height = 32
Flat = True
Glyph.Data = {
360C0000424D360C000000000000360000002800000020000000200000000100
180000000000000C000000000000000000000000000000000000FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CED241C
ED241CED241CED241CED241CED241CED241CED241CED241CED241CED241CED24
1CED241CED241CED241CED241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CED241C
ED241CED241CED241CED241CED241CED241CED241CED241CED241CED241CED24
1CED241CED241CED241CED241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CED241C
ED241CED241CED241CED241CED241CED241CED241CED241CED241CED241CED24
1CED241CED241CED241CED241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CED241C
ED241CED241CED241CED241CED241CED241CED241CED241CED241CED241CED24
1CED241CED241CED241CED241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CED241C
ED241CED241CED241CED241CED241CED241CED241CED241CED241CED241CED24
1CED241CED241CED241CED241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDCC483FCC483F
CC483FCC483FCC483FCC483FCC483F241CED241CED241CED241CED241CEDCC48
3FCC483FCC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDCC483FCC483F
CC483FCC483FCC483FCC483FCC483F241CED241CED241CED241CED241CEDCC48
3FCC483FCC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDCC483FCC483F
CC483FCC483FCC483FCC483FCC483F241CED241CED241CED241CED241CEDCC48
3FCC483FCC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDCC483FCC483F
CC483FCC483FCC483FCC483FCC483F241CED241CED241CED241CED241CEDCC48
3FCC483FCC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CEDCC483FCC483F
CC483FCC483FCC483FCC483FCC483F241CED241CED241CED241CED241CED241C
ED241CED241CED241CED241CED241CED241CED241CED241CED241CED241CED24
1CED241CED241CED241CED241CED241CED241CED241CED241CEDCC483FCC483F
CC483FCC483FFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CED241C
ED241CED241CED241CED241CED241CED241CED241CED241CED241CED241CED24
1CED241CED241CED241CED241CED241CED241CED241CED241CEDCC483FCC483F
CC483FCC483FFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CED241C
ED241CED241CED241CED241CED241CED241CED241CED241CED241CED241CED24
1CED241CED241CED241CED241CED241CED241CED241CED241CEDCC483FCC483F
CC483FCC483FFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CED241C
ED241CED241CED241CED241CED241CED241CED241CED241CED241CED241CED24
1CED241CED241CED241CED241CED241CED241CED241CED241CEDCC483FCC483F
CC483FCC483FFFFFFFFFFFFFFFFFFF241CED241CED241CED241CED241CED241C
ED241CED241CED241CED241CED241CED241CED241CED241CED241CED241CED24
1CED241CED241CED241CED241CED241CED241CED241CED241CEDCC483FCC483F
CC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC483FCC48
3FCC483FCC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC483FCC483F
CC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC483FCC48
3FCC483FCC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC483FCC483F
CC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC483FCC48
3FCC483FCC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC483FCC483F
CC483FCC483FCC483FCC483FCC483FCC483FCC483FCC483FCC483FCC483FCC48
3FCC483FCC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC483FCC483F
CC483FCC483FCC483FCC483FCC483FCC483FCC483FCC483FCC483FCC483FCC48
3FCC483FCC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC483FCC483F
CC483FCC483FCC483FCC483FCC483FCC483FCC483FCC483FCC483FCC483FCC48
3FCC483FCC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC483FCC483F
CC483FCC483FCC483FCC483FCC483FCC483FCC483FCC483FCC483FCC483FCC48
3FCC483FCC483FCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}
end
end
end
这是它的外观。实际上它运行得稍微快一些,但是录制视频和gif转换会使其减速一些。
TButton
。无论如何,我无法在 Delphi Tokyo 中重现。 - Victoria.bmp
作为图标) - Tom Brunberg