Skip to content

Instantly share code, notes, and snippets.

View viniciusfbb's full-sized avatar

Vinícius Felipe Botelho Barbosa viniciusfbb

View GitHub Profile
@viniciusfbb
viniciusfbb / Skia.TextShadow.pas
Created January 22, 2023 14:07
Text shadow example using the Skia4Delphi library
uses
Skia, Skia.FMX.Graphics;
procedure TForm1.SkPaintBox1Draw(ASender: TObject; const ACanvas: ISkCanvas;
const ADest: TRectF; const AOpacity: Single);
var
LTextLayout: TSkTextLayout;
LPaint: ISkPaint;
begin
LTextLayout := TSkTextLayout.Create;
@viniciusfbb
viniciusfbb / fmx.svg
Created May 19, 2023 02:56
Firemonkey Artwork #delphi
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@viniciusfbb
viniciusfbb / ResizeImage.pas
Last active June 21, 2024 11:49
Resizing image using Skia4Delphi
function GetResizedImage(const AImage: ISkImage; ATargetWidth, ATargetHeight: Integer;
ASamplingOptions: TSkSamplingOptions; AProgressive: Boolean = True): ISkImage;
function MakeResized(const AImage: ISkImage; ANewWidth, ANewHeight: Integer): ISkImage;
var
LSurface: ISkSurface;
begin
LSurface := TSkSurface.MakeRaster(ANewWidth, ANewHeight);
LSurface.Canvas.Clear(0);
LSurface.Canvas.Scale(ANewWidth / AImage.Width, ANewHeight / AImage.Height);
program SkiaBlur2;
uses
System.StartUpCopy,
FMX.Forms,
FMX.Skia,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}