请高人解决一下DELPHI图象显示问题!!

来源:百度知道 编辑:UC知道 时间:2024/05/31 22:23:45
procedure tform1.button1click(sender: tobject); //上拉
var
newbmp: tbitmap;
i,bmpheight,bmpwidth:integer;
begin
newbmp:= tbitmap.create;
newbmp.width:=image1.width;
newbmp.height:=image1.height;
bmpheight:=image1.height;
bmpwidth:=image1.width;
for i:=0 to bmpheight do
begin
newbmp.canvas.copyrect(rect
(0,bmpheight-i,bmpwidth,bmpheight),
image1.canvas,
rect(0,0,bmpwidth,i));
form1.canvas.draw(120,100,newbmp);
end;
newbmp.free;
end;

procedure tform1.button5click(sender: tobject); //水平交错
var
newbmp:tbitmap;
i,j,bmpheight,bmpwidth:integer;
begin
newbmp:= tbitmap.create;
newbmp.width:=image1.width;
newbmp.height:=image1.height;
bmpheight:=image1.height;
bmpwidth:=image1.width;
i:=0;
while i< =bmpwidth do
begin
j:=i;
while j >0 do
begin
newbmp.canvas.copyrect(rect(j-1,0,

源代码给我,我给你改,注释也给你加上。

百度HI在线。

我只改了两个,希望对你有帮助.但是我对图片的处理后的效果不太懂,你要的效果我不知道是不是这样的...

procedure TForm1.Button1Click(Sender: TObject);
var
newbmp: tbitmap;
i,bmpheight,bmpwidth:integer;
begin

image1.Picture.Bitmap.LoadFromFile('E:\IMAGE\222.bmp'); //先把要读取的图片读到Image1中,为的是得到长宽高

newbmp:= tbitmap.create;
newbmp.width:=image1.width;
newbmp.height:=image1.height;
bmpheight:=image1.height;
bmpwidth:=image1.width;

image1.Picture := nil; //清空Image1

newbmp.LoadFromFile('E:\IMAGE\222.bmp'); //读图片 图片位置自己定

for i:=0 to bmpheight do
begin
newbmp.canvas.copyrect(rect(0,bmpheight-i,bmpwidth,bmpheight), image1.canvas, rect(0,0,bmpwidth,i));
Image1.canvas.draw(0,0,newbmp); //在Image1中显示图片 图片位置从左上角开始
end;

newbmp.free;
end;

procedure TForm1.Button5Click(Sender: TObject);
var
newbmp:tbitmap;
i,j