Skip to content

Instantly share code, notes, and snippets.

View viniciusfbb's full-sized avatar

Vinícius Felipe Botelho Barbosa viniciusfbb

View GitHub Profile
@Raygunpewpew1
Raygunpewpew1 / CustomCardGrid.pas
Last active February 14, 2026 15:31
High-Performance Virtualized Grid & Rich Text in Delphi FMX (Skia)
unit CustomCardGrid;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes,
System.Generics.Collections, System.Math, FMX.Types, FMX.Controls,
FMX.Graphics, FMX.Objects, FMX.Layouts, FMX.Ani, FMX.Forms, FMX.Platform,
System.Skia, FMX.Skia.Canvas, MTGCore, CardPriceTypes;
program SkiaBlur2;
uses
System.StartUpCopy,
FMX.Forms,
FMX.Skia,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
@viniciusfbb
viniciusfbb / PixelCopy.Android.pas
Last active February 3, 2026 15:30
Delphi capture screenshot from android Firemonkey form
unit PixelCopy.Android;
interface
uses
Androidapi.JNI.GraphicsContentViewText,
FMX.Graphics;
function CaptureWindowPixels(const AWindow: JWindow): TBitmap;
function CaptureSurfaceHolderPixels(const ASurfaceHolder: JSurfaceHolder): TBitmap;
@viniciusfbb
viniciusfbb / ResizeImage.pas
Last active February 3, 2026 15:31
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);
@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 / 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 / KeyName.pas
Created November 28, 2022 15:04
Delphi FMX key name, used in OnKeyDown/OnKeyUp
function KeyName(const AKey: Word): string;
begin
case AKey of
1: Result := 'vkLButton';
2: Result := 'vkRButton';
3: Result := 'vkCancel';
4: Result := 'vkMButton';
5: Result := 'vkXButton1';
6: Result := 'vkXButton2';
8: Result := 'vkBack';
@viniciusfbb
viniciusfbb / SimpleResize.pas
Created November 7, 2022 17:41
Simple example resizing an image using Skia4Delphi
uses
System.UITypes, Skia;
function GetResizedImage(const AImage: ISkImage; const ANewWidth, ANewHeight: Integer): ISkImage;
var
LSurface: ISkSurface;
begin
LSurface := TSkSurface.MakeRaster(ANewWidth, ANewHeight);
LSurface.Canvas.Clear(TAlphaColors.Null);
LSurface.Canvas.Scale(ANewWidth / AImage.Width, ANewHeight / AImage.Height);
@viniciusfbb
viniciusfbb / Skia.FitAndCrop.pas
Last active August 18, 2023 06:55
Fit and crop a image using Skia4Delphi
unit Skia.FitAndCrop;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Math,
System.Math.Vectors, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics,
FMX.Objects, Skia, Skia.FMX;
type
@viniciusfbb
viniciusfbb / LogTail4Delphi.pas
Last active July 6, 2022 15:07
LogTail integration for Delphi
uses
iPub.Rtl.Refit; // https://github.com/viniciusfbb/ipub-refit
type
TLogMessageLevel = (Info, Warning, Error);
TLogMessage = record
Dt: TDateTime;
Level: TLogMessageLevel;
&Message: string;