Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey, Delphi Android, Delphi IOS

Custom Filter Effect Image Shaders In Delphi Firemonkey For Android And IOS

| Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

Delphi Firemonkey Filters And Shaders | Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOSOne 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.

Exit mobile version