Pergunta

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?

Foi útil?

Solução

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.

Outras dicas

  • 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.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top