Closed PeterPanino closed 3 years ago
Actually if you set Stretch to True and Proportional to False the component draws the image as the size of the SVGIconImage target. Look into Paint method: LSVG.PaintTo(Canvas.Handle, TRectF.Create(LOrigin, LWidth, LHeight), FProportional); It's quite simple to add the method you need: try yourself and make a pull-request ;-)
Look into CategoryButtonTest, there is an example to draw "stretched" image from an SVGIconImage to a PaintBox, calling:
SVGIconImage.svg.PaintTo(PaintBox1.Canvas.Handle,
PaintBox1.ClientRect, False);
The last param (False) is for KeepAspectRatio: with False the image is painted as the entire dimension of the paintbox. You must download the latest version of the repo.
The TSVGIconImage.PaintTo method draws a fixed-size image to the target Canvas.
Please add a similar method TSVGIconImage.StretchDrawTo(Canvas: TCanvas) that fills the whole target Canvas (independently from its size) with the SVG image. That would be more flexible.