FMX.ShaderFilters Sample

From RAD Studio Code Examples
Jump to: navigation, search

This sample illustrates how to apply visual effects to images with FireMonkey.

Location

You can find the ShaderFilters sample project at:

  • Start | Programs | Embarcadero RAD Studio Athens | Samples and navigate to:
    • Object Pascal\Multi-Device Samples\User Interface\ShaderFilters
  • Subversion Repository:
    • You can find Delphi code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.

Description

This application uses images on a form and applies several visual effects on them with TSplitter and TFloatAnimation.

How to Use the Sample

  1. Navigate to the location given above, and open ShaderFilters.dproj.
  2. Press F9 or choose Run > Run. To apply a specified effect to the image, select an item from the list of effects in the left.

Classes

New FireMonkey Image Show represents the main window of the sample. It contains the following components:

Implementation

  • The first TListBox displays the main categories of effects.
  • When you select a category of effects from the first TListBox, a list with several specific effects is displayed in the second TListBox.
  • When you select a specific item from the list of effects, the respective effect is applied to the image.
  • The second TListBox is subordinated to the first one. The second TListBox displays the effects subordinated to the category selected from the first TListBox.
  • The selected effect is applied to the Source and Target images and a preview of the result is displayed on the Dest area.
  • Some of the effects have additional characteristics (BlurAmount, BrushSize, and so on). When you select one of these effects, the options are displayed in the third TListBox. Use the TScrollBar to change the characteristics of the effect.
  • The effects from the Transition main category have an additional button labeled as Play/Pause. Click this button to preview the picture transition.
  • When you click the Benchmark button, the label next to the button displays the amount of time that passes until the effect is applied to the picture.
  • Some of the effects use TSelectionPoint selection points to locate areas of effects. For example, the Transition -> Line Transition effect shows three selection points, which can be used to move color gradient boundaries. The Distortion -> Pinch effect shows a selection point, which can be used to move the pinched region showing a magnified background. See how the Shape: TSelectionPoint; object is used.

Uses

See Also

Samples