[Gambas-user] DrawingArea. How to scale the view?

Benoît Minisini g4mba5 at gmail.com
Fri Dec 17 23:28:15 CET 2021


Le 17/12/2021 à 23:16, Martin Belmonte a écrit :
> Hi folks.
> I want to view the whole image (SVG) loaded in a DrawingArea but it 
> seems to be impossible. ¿Or not?
> 
> Screenshoot: https://imgur.com/a/HiRa8Mj
> 
> Note: Please see the attached sample poroject.
> 
> Al the best.
> Martin.
> 
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> 

By default a SVG image has a dimension in points, that is converted to 
pixels at loading using a 72 DPI resolution (and not the resolution of 
the target device used for painting, which is not known at loading time).

To scale it, you can use the optional arguments of the SvgImage.Paint() 
method that defines the target rectangle that will be filled by the SVG 
image, or the Paint matrix (Paint.Translate, Paint.Scale, Paint.Rotate...).

Regards,

-- 
Benoît Minisini


More information about the User mailing list