forms - 在表格/图像上快速绘图时如何消除闪烁效果?
问题描述
每当我在表单/图像上绘图或更改元素(例如按钮)的位置时,表单会短暂闪烁,然后正确显示。这个错误发生在我制作的所有应用程序中,我还没有找到解决方案。
任何事情都会Button1.Left=100
导致Form1.Canvas.Ellipse(10,10,40,40)
这种效果发生。
我认为这与表格重新计算要显示的内容有关吗?
例子:
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.Imaging.GIFImg;
type
TForm1 = class(TForm)
Image1: TImage;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Image1.Left:=Image1.Left+1;
end;
end.
这是一个简单的例子。当图像由于某种原因移动时,它会闪烁
解决方案
推荐阅读
- c# - 从鼠标位置缩放和翻译图像
- raku - 为什么 Rakudo dd 为类型化和分配的标量返回 Nil?
- firebase - 如何在firebase中进行此查询?
- ios - 电子邮件中的图像在 iOS Outlook App 中的缓存不一致
- windows - 如何通过 powershell ISE 脚本编辑安全选项(在本地安全策略中)?
- c# - 有人可以指出我的问题吗?我似乎无法打印出我的枚举类的第一个元素
- javascript - JS:将setter添加到父级,getter在哪里
- c# - API 端点查询参数 - 返回什么?
- php - 如何在 Wordpress 的过滤器函数中传递输入值?
- locust - 如何获取用户上下文/线程ID来区分任务序列