User Tools

Site Tools


Pixmap

Script wrapper for QPixmap.

More...

Inherits :

Properties

Constructors

DAZ Script
Pixmap ()
Pixmap ( Pixmap pixmap )
Pixmap ( String filename )

Methods

DAZ Script
voidfill ( Color color )
voidfromImage ( Image image )
BooleanisNull ()
Booleanload ( String filename, String format=“” )
BooleanloadFromData ( ByteArray data, String format=“” )
voidresize ( Number width, Number height )
voidresize ( Size size )
voidsave ( String filename )
ImagetoImage ()

Detailed Description

This is the script counterpart to the QPixmap type used in the C++ SDK.

Attention:

  • Inheritance will change to Object in a pending update.

Properties


Number : depth

The color depth of the pixmap (Read-Only)


Number : height

The height of the pixmap in pixels (Read-Only)


Rect : rect

The enclosing rectangle of the pixmap in pixels (Read-Only)


Size : size

The size of the pixmap (Read-Only)


Number : width

The width of the pixmap in pixels (Read-Only)

Constructors


Pixmap()

Default Constructor.


Pixmap( Pixmap pixmap )

Copy Constructor.

Parameter(s):

  • pixmap - The Pixmap to copy.

Pixmap( String filename )

Parameter(s):

  • filename - The name of the file to load the pixmap's data from.

Methods


void : fill( Color color )

Fills the pixmap with color.

Parameter(s):

  • color - The color to set all the pixels in the pixmap.

void : fromImage( Image image )

Parameter(s):

  • image - The image to convert.

See Also:

Since:

  • 4.9.3.105

Boolean : isNull()

Gets whether or not the pixmap is Null.

Return Value:

  • true if this is a Null (empty) pixmap, false if the pixmap has data.

Boolean : load( String filename, String format=“” )

Loads data into the pixmap from a file.

Parameter(s):

  • filename - The name of the file to load into the pixmap.
  • format - The image format of the bytes in the file pointed to by filename. If this is an empty string (default), an image format will be chosen from fileName extension. Supported image formats are BMP, GIF, JPG, JPEG, PNG, PBM, PGM, PPM, XBM, XPM and SVG. (since 4.11.0.155)

Return Value:

  • true if the data was loaded, otherwise false. (since 4.11.0.155)

Boolean : loadFromData( ByteArray data, String format=“” )

Loads data into the pixmap from a byte array using the specified format.

Parameter(s):

  • data - The binary data to load into the pixmap.
  • format - The image format of the bytes in data. Supported image formats are BMP, GIF, JPG, JPEG, PNG, PBM, PGM, PPM, XBM, XPM and SVG.

Return Value:

  • true if the data was loaded, otherwise false. (since 4.10.0.88)

void : resize( Number width, Number height )

Resizes the pixmap.

Parameter(s):

  • width - The new width for the pixmap.
  • height - The new height for the pixmap.

void : resize( Size size )

Resizes the pixmap.

Parameter(s):

  • size - The new size for the pixmap.

void : save( String filename )

Saves the pixmap to a file.

Parameter(s):

  • filename - The name of the file to save the pixmap to.

Image : toImage()

Return Value:

  • The pixmap converted to an image, or null if the conversion fails.

See Also:

Since:

  • 4.9.3.105