Delphi Tutorials »

How to tile a background image?


Delphi programmers often ask how they can set a "repeated" (tiled) background image for a form. Do you suppose that this can be done by setting some property of the form to the location of the image? This is perfectly understandable, since you can do this for an HTML page. This might be a handy addition to Delphi, but for the moment you still have to program this feature.

A quick example:

  1. Add an Image component to your form.
  2. Let its Picture property point to a graphic. Or load the graphic during runtime, as is done in our example.
  3. Each time the form is repainted, copy the Image's bitmap as many times as is necessary to fill the entire form.

There's an example project TILING.ZIP in our Download section, under the heading Tutorial Projects.


 

Crash Course Delphi Become member of the DelphiLand Club and get our Crash Course Delphi, plus the fully commented source code of numerous projects, plus guaranteed answers from our Q/A Forum. Membership is for life!

TOP   DelphiLand Club Membership  DC Library  Forum  Forum Archives  Crash Course Delphi  Tips  Source Code  Downloads  Links

© Copyright 1999-2066
Studiebureau Festraets