Loading Delphi 12 Skia SVG at Run time from FNC Bitmap Container

Hi TMS Team,

I use mainly new D12 Skia images for FMX app.
Because I have 100+ SVG files I would like to put them in SVG collection, and load at run time.

I can add SVG to TTMSFNCBitmapContainer.

How to load SVG items at run-time?
I use now: skSvg1.Svg.Source := TFile.ReadAllText(filename);
TMS solution: skSvg1.Svg.Source := TMSFNCBitmapContainer1.GetItem(i) ???

As I understand "TTMSFNCSVGImageCollection" supports Windows only.

Thank you.

procedure TForm1.FormCreate(Sender: TObject);
var
  s: TStringStream;
begin
  s := TStringStream.Create;
  try
    TMSFNCBitmapContainer1.GetItem(0).Bitmap.SVG.SaveToStream(s);
    skSvg1.Svg.Source := s.DataString;
  finally
    s.Free;
  end;
end;
1 Like

Thank you Pieter and TMS Team for another "5 star" component and support!

TMS Bitmap containers help to organize all SVG's in groups, keep all resources in one file, and get max performance from using new TSkSvg components.

In my case all images ("objects") is rendered 3D graphics, 100+ files, all animated, with FMX effects. I use free "Inkscape" graphic software to convert transparent PNG to SVG for Skia.
Delphi 12 Skia Performance and UI quality is fantastic.

BTW, I've replaced all "load from svg files" with this TMS solution :

procedure TTabbedForm.LoadSkSvg(SvgContainer: TTMSFNCBitmapContainer; SkSvg: TSkSvg; ImgName: string);
var
s: TStringStream;
SvgSrc: TTMSFNCBitmap;
begin
SvgSrc := SvgContainer.FindBitmap(ImgName);
if Assigned(SvgSrc) then
begin
s := TStringStream.Create;
try
SvgSrc.SVG.SaveToStream(s);
SkSvg.Svg.Source := s.DataString;
finally
s.Free;
end;
end;
end;

Thank you for the feedback!