Picture (gb.qt4)

This class represents a picture.

The picture contents are stored in the display server, not in the process memory like an Image.

Even if the underlying toolkit does not completely manage transparency yet, each picture can have a mask. This feature can be set explicitly at picture instantiation, or implicitly when loading an image file that has transparency like PNG.

When drawing on a picture having a mask, the picture and the mask are modified accordingly.

This class is creatable.

This class acts like a read / write static array.

Static methods
Flush   Flushes the internal picture cache.
FromString   Create a picture from the contents of a string.
Load   Loads a picture from the disk.
Refresh   Trigger a redraw of the control.

Properties
Depth   Returns the color depth of the picture.
H   A synonymous for the Height property.
Height   Returns the height of the picture.
Image   Converts the picture into an image and returns it.
Transparent   Returns or sets if the picture has a mask.
W   A synonymous for the Width property.
Width   Returns the width of the picture.

Methods
Clear   Clears the picture.
Copy   Returns a copy of the picture, or a copy of a part of the picture.
Fill   Fills the picture with the specified color.
Resize   Resizes a picture.
Save   Saves a picture to the disk. The file extension of Path will give the format of the saved image.
Stretch   Return a stretched copy of a picture.
ToString   Save an image as a string.

Tip:

Calling something like...
Picture["/tmp/TemporaryPicture.png"]
will load the picture from the disk if it has not already done so.
If it has already loaded this picture calling the same file path again will load the cached picture from the display server and not from disk.

If you wish to reload the same picture path from disk you must use the Picture.Load(Path) method.
Picture.Load("/tmp/TemporaryPicture.png")