在form窗体上入一个image控件加载一个图片做底图,然后放一个BUTTON控件,用一个TIMER控件来改变button控件的位置时,出现以下问题:
当image的属性stretch:=true时移动的速度很慢,但把stretch:=false时移动速度很快,这是一个DELPHI不足地方吗?有高手能解决这样的一个问题吗?
当image的属性stretch:=true时移动的速度很慢,但把stretch:=false时移动速度很快,这是一个DELPHI不足地方吗?有高手能解决这样的一个问题吗?
解决方案 »
- 应用控件Report Machine 3.0--老是提示:File not Found :"RM_DataSource.dcu"之类信息。
- 有图形设计的问题!请各位大侠多多指教!!!随便散分!!!
- 在线等待...急用啊
- 请问如何在两个表单之间进行参数传递
- 请问如何现实这个目标?
- 进行串行口通信的TMSComm控件在Delphi7环境下的哪个标签页?
- 请大家帮忙,学习C/S结构的方法,最好能给我一个简单的例子。
- oracle中保存BLOB字段的问题
- ClientDataSet中如何设置主健?
- 文科生讀計算机科學與技朮是不是會太難???
- 征集新年祝福公司客户的用词,(写在贺卡和礼物上的)!
- 我将在下周推出免费邮件群发&群收系统.
当Image.Stretch=true时,这种拉伸的计算是很费时间的.
因此.如果图片大小不会有变化,最好不要用Strentch
加上后一样有同样问题出现,我把代码贴出让大家看一下
unit xiaocode;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, jpeg, SUIImagePanel;type
TForm1 = class(TForm)
Timer1: TTimer;
Button7: TButton;
Button6: TButton;
Button5: TButton;
Button4: TButton;
Button3: TButton;
Button2: TButton;
Button1: TButton;
Image1: TImage;
procedure Button2Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button2Click(Sender: TObject);
begin
button1.Left :=-10;
button3.Left :=-10;
button4.Left :=-10;
button5.Left :=-10;
button6.Left :=-10;
button7.Left :=-10;
timer1.Enabled :=true;
end;procedure TForm1.Timer1Timer(Sender: TObject);
begin
Form1.DoubleBuffered := true;
if button1.Left<=250 then
button1.Left :=button1.Left+20
else
if button3.Left<=250 then
button3.Left:=button3.Left+20
else
if button4.Left<=250 then
button4.Left:=button4.Left+20
else
if button5.Left<=250 then
button5.Left:=button5.Left+20
else
if button6.Left<=250 then
button6.Left:=button6.Left+20
else
if button7.Left<=250 then
button7.Left:=button7.Left+20
else
timer1.Enabled :=false;end;procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.DoubleBuffered := true;
end;end.
你试试如下代码:(未测试)
image1.enabled:=false;
//移动button;
iamge1.enabled:=true;