Board index » delphi » Tiling background images

Tiling background images

I'd like to tile a small background image in my application.  I can do
this with no problem in FoxPro, but I'm not having any luck in Delphi.

I've tried putting a TImage on a Tile and playing with different
properties but no go.

Any help?

Eric

 

Re:Tiling background images


Quote
Eric Young wrote:

> I'd like to tile a small background image in my application.  I can do
> this with no problem in FoxPro, but I'm not having any luck in Delphi.

> I've tried putting a TImage on a Tile and playing with different
> properties but no go.

> Any help?

> Eric

Put the following code in the form OnPaint event.

{paint form background}
 With Bitmap do begin
   W:=Width;
   H:=Height;
  end;
 Y:=0;
 While Y<Height do
  begin
   X:=0;
   While X<Width do
    begin
     Canvas.Draw(X,Y,Bitmap);
     Inc(X,W);
    end;
   inc(Y,H);
  end;

Other Threads