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?

有帮助吗?

解决方案

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.

其他提示

  • 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.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top