EtheaDev / SVGIconImageList

Three engines to render SVG (Delphi Image32, Skia4Delphi, Direct2D wrapper) and four components to simplify use of SVG images (resize, fixedcolor, grayscale...)
Apache License 2.0
327 stars 96 forks source link

Skia SVG seems to ignore KeepAspectRatio parameter of ISVG.PaintTo #222

Closed birbilis closed 2 years ago

birbilis commented 2 years ago

image

see screenshot from modified SVGViewer demo (just changed True to False)

birbilis commented 2 years ago

btw, in that file

procedure TSVGPaintBox.DrawFile(const AFileName: string);
begin
  try
    FSvg.LoadFromFile(AFileName);

should write "FSVG.LoadFromFile" for consistency

birbilis commented 2 years ago

btw, I tried that demo since it had stretch (aka not keep aspect ratio) option. I don't see TSVGIconImage having such property, nor other way to do more advanced placement (tiling etc.), like the options in https://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.Objects.TImage.WrapMode

update: to answer my own question, since TSVGIconImage descends from TImage (hadn't noticed) one can just do MySVGImg.WrapMode := TImageWrapMode.Stretch; wonder how I hadn't noticed (maybe much older version didn't descent from TImage)