… = Picture[…] (gb.qt4)
Dim hPicture
As Picture
hPicture
= Picture
[ Path As String [ , Size As String ] ]
Returns a
Picture object from the internal picture cache.
If the picture is not present in the cache, it is automatically loaded from the
specified file.
If
Path begins with
"icon:/"
, then it means that you want to get a stock icon.
This icon is get by using the
Stock class in the
gb.form component.
If
Size is specified the loaded pictures width and height are both stretched to match the size,
This argument is a single string value like the
Stock class sizes, either a number or a word tiny, small, medium, large, huge.
If the system is using a dark theme then the image is converted using Image.
Invert(True)
Examples
' Put a standard "close" icon inside a button
MyButton.Picture = Picture["icon:/16/close"]
' Put a custom "close" picture inside a button and resize it to stock size medium
MyButton.Picture = Picture["./IncludedIcons/close.png", "medium"]
Warning:
If you do not want the image automatically inverted when using a dark theme then you must use the Picture.
Load method instead.