One useful feature of Delphi Firemonkey is that because it draws all the forms using your 3D card you have access to the 3D card’s shader capabilities. The Delphi Firemonkey effect filters are based on this system. Some example effects that you can apply to images are emboss, pencil stroke, sharpen, toon, pixelate, and a whole lot more. However, if you want to write your own shaders and turn them into effect components for use in your IOS and Android apps it can be a daunting task. Thankfully someone else has written up a full blog post with extensive examples on exactly how to use shaders to create your own effects that you can use in Delphi XE5 Firemonkey.
const
 Â
FilterName =
'FrostyOutline'
;
 Â
//FilterName = 'Emboss';
 Â
//FilterName = 'Invert';
begin
 Â
Filter := FilterByName(FilterName);
 Â
Filter
.
Values[
'Height'
] :=
300
;
 Â
Filter
.
Values[
'Width'
] :=
350
;
 Â
Filter
.
ValuesAsBitmap[
'Input'
] := Source
.
Bitmap;
 Â
Dest
.
Bitmap := TBitmap(Filter
.
ValuesAsBitmap[
'output'
]);
end
;
Check out the full blog post on how to create custom filter effects.
1 Comment