在OnPaint事件里: var x,y:integer; begin y:=0; while y <Height do begin X:=0; while X<Width do begin Canvas.Draw(X,Y,Image1.Picture.Bitmap); //Image1.Picture.Bitmap要平铺的图片 X:=X+Image1.Picture.Bitmap.Width; end; Y:=Y+Image1.Picture.Bitmap.Height; end; end;
procedure TForm1.Form1Paint(Sender:TObject); begin Canvas.StretchDraw(Rect(0,0,Width,Height),Picture{eg:TIcon}); //这是拉伸 end;
procedure TForm1.Form1Paint(Sender:TObject); begin Canvas.StretchDraw(Rect(0,0,Width,Height),Picture{eg:TIcon}); end;
var
x,y:integer;
begin
y:=0;
while y <Height do
begin X:=0;
while X<Width do
begin
Canvas.Draw(X,Y,Image1.Picture.Bitmap);
//Image1.Picture.Bitmap要平铺的图片
X:=X+Image1.Picture.Bitmap.Width;
end;
Y:=Y+Image1.Picture.Bitmap.Height;
end;
end;
begin
Canvas.StretchDraw(Rect(0,0,Width,Height),Picture{eg:TIcon});
//这是拉伸
end;
begin
Canvas.StretchDraw(Rect(0,0,Width,Height),Picture{eg:TIcon});
end;