|Home | Tutorial | Classes | Functions | QSA Workbench | Language | Qt API | QSA Articles | Qt Script for Applications |

[Prev: Font] [Home] [Next: Built-in Objects]

#### Pixmap

The `Pixmap` class can be used to represent images in QSA. Instances of `Pixmap` can be passed to C++ slots that take arguments of type QPixmap.

The `Pixmap` constructor can take a filename referring to an image that will then be loaded:

    var background = new Pixmap( "background.png" );

##### Pixmap Properties

- width : Number; The width of the pixmap. This value is read-only.

- height : Number; The height of the pixmap. This value is read-only.

- rect : Rect; The enclosing rectangle (0, 0, width, height) of the pixmap. This value is read-only.

- size : Size; The size of the rectangle. This value is read-only.

- depth : Number; The color depth of the pixmap. The pixmap depth is also called bits per pixel (bpp) or bit planes of a pixmap. A null pixmap has depth 0. This value is read-only.

##### Pixmap Functions

- isNull() : Boolean; Returns true if this is a null pixmap; otherwise returns false. A null pixmap has zero width, zero depth, and no contents.

- fill( color ); Fills the pixmap with the specified color.

- resize( size : Size ); Resizes the pixmap to the specified size.

- resize( width : Number, height : Number ); Resizes the pixmap to the specified dimensions.

- load( fileName : String ); Loads the pixmap data from the specified file.

- save( fileName : String ); Saves the pixmap to the specified file.

[Prev: Font] [Home] [Next: Built-in Objects]