Domanda

In my FMX Application I have to fill the entire background area of my form using a Bitmap pattern.
The reason why I'm thinking to use this pattern is because the form is freely resizable by the user and whether I set a fixed image the stretch causes the loss of quality of the background.

Is there a way to use a small Bitmap pattern I can repeat (X and Y) to fill the whole form area according to the resizing?

È stato utile?

Soluzione

The effect you are looking for is a Tile.

See TTilerEffect and FireMonkey_Image_Effects for documentation.

The properties HorizontalTileCount and VerticalTileCount controls how many times a bitmap will be replicated. Since these values are floats, you need to adapt their values when the form is rescaled.

Altri suggerimenti

  • Add a TImage to the form
  • Make all the other controls children of it (so they appear on top).
  • Set the image's Align to alClient.
  • Load the Bitmap.
  • Set the WrapMode to imTile.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top