procedure TForm1.Button1Click(Sender: TObject);
var
newbmp:TBitmap;
i,bmpheight,bmpwidth:integer;
begin
newbmp:=TBitmap.Create ;
newbmp.Height :=image1.Height ;
newbmp.Width :=image1.Width ;
bmpheight:=image1.Height+10 ;
bmpwidth:=image1.Width+10 ;
for i:=10 to bmpheight do
begin
newbmp.Canvas.CopyRect (rect(0,bmpheight-i,bmpwidth,bmpheight),
image1.canvas,rect(0,0,bmpwidth,i));
form1.Canvas.Draw (0,0,newbmp );
end;
newbmp.free;
end;
var
newbmp:TBitmap;
i,bmpheight,bmpwidth:integer;
begin
newbmp:=TBitmap.Create ;
newbmp.Height :=image1.Height ;
newbmp.Width :=image1.Width ;
bmpheight:=image1.Height+10 ;
bmpwidth:=image1.Width+10 ;
for i:=10 to bmpheight do
begin
newbmp.Canvas.CopyRect (rect(0,bmpheight-i,bmpwidth,bmpheight),
image1.canvas,rect(0,0,bmpwidth,i));
form1.Canvas.Draw (0,0,newbmp );
end;
newbmp.free;
end;
解决方案 »
- 刚开始自学Delphi,有些困惑!
- 用Delphi实现Msgina.dll中的函数~!
- 在线程中更新窗体上的ListView控件上的内容,更新时如果不使用Synchronize(更新函数)就会抱错Code:1400,使用的话又会导致界面无响应
- 新手问题
- 如何监测cpu和内存的使用情况(代码),急(100)相送
- Delphi7.0有没有简体中文版?不是汉化的那种。
- 我想在作安装文件的时候,让Windows启动时,自动启动,
- 窗体的释放用哪个函数好?
- 重回论坛,散分
- 有没有惠州的程序员?
- 请教如何用delphi实现接收所有ping过来的icmp数据包并提取出来的啊?
- 如何在DBGRID中嵌入复选框?
因为i从10变化到bmpheiht,而Image的宽度和高度比newbmp的要小!所以Image1.canvas的rect计算有误!自己修改吧!问题倒不是很难。
for i:=10 to bmpheight do
begin
newbmp.Canvas.CopyRect (rect(0,bmpheight-i,bmpwidth,bmpheight),
image1.canvas,rect(0,0,bmpwidth,i));
form1.Canvas.Draw (0,0,newbmp );
end;
newbmp.free;
end;
//也不知道是不适合你的要求。
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:=0 to Image1.Width do
begin
form1.Canvas.CopyRect(Rect(i,0,i+1,image1.Height),image1.Canvas,Rect(i,0,i+1,image1.Height));
sleep(20);
end;
end;