This sample illustrates how to apply visual effects to images with FireMonkey.
You can find the ShaderFilters sample project at:
- Start | Programs | Embarcadero RAD Studio Sydney | 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.
How to Use the Sample
- Navigate to the location given above, and open ShaderFilters.dproj.
- 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.
New FireMonkey Image Show represents the main window of the sample. It contains the following components:
- Three TImage objects
- Three TListBox objects
- Two TSplitter objects
- Two TPanel objects
- A TAniIndicator
- Two TButton objects
- A TLabel
- A TStyleBook
- Two TLayout objects
- 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.
- FireMonkey Image Filters sample