New Picture (gb.gtk)
Dim hPicture
As Picture
hPicture
= New Picture ( [ Width As Integer, Height As Integer, Transparent As Boolean ] )
Creates a new picture.
If the
Width and
Height are not specified, the new picture is void.
You can specify if the picture has a mask with the
Transparent parameter.
Warning
Like Image, Picture contents are uninitialized by default.
The GTK+ component works a bit different to qt5, because Image and Picture are actually the same object internally.
So, your new Image or Picture may or may not be initialized by default depending on your system, you can't rely on it so assume that
the initial contents could be random and you should fill the background color first.
To avoid problems either set the
Transparent argument to true to initially fill with transparency or
Fill with a color.
Eg.
' initialize a transparent background picture.
Dim hPicture As Picture = New Picture(100, 100, True)
Or....
' initialize a colored background picture with button background color.
Dim hPicture As Picture = New Picture(100, 100) ' initialize picture.
hPicture.Fill(Color.ButtonBackground) ' now colorize it to be sure.