Documents > BPS V2 Script API
bps::Pixmap Class Reference

A wrapper for QPixmap. More...

List of all members.

Public Member Functions

Boolean load (String aFileName)
 Load a pixmap from a file.
Boolean loadFromData (ByteArray aData)
 Load a pixmap from memory data.
 Pixmap ()
 Default constructor: creates an empty pixmap.
 Pixmap (String aFileName)
 Initializing constructor.
Boolean save (const QString &aFileName)
 Save pixmap to a file.
ByteArray saveToData (const QString &aFormat)
 Save pixmap to in memory data in a file format.
String toString () const

Properties

Number depth
 The depth in bits.
Number height
 The height in pixels.
Boolean isNull
 True if the pixmap is empty.
Number width
 The width in pixels.

Detailed Description

A wrapper for QPixmap.

All Qt image files are supported.

Example use within a report:

 // change pixmap 
 var pm = new bps.Pixmap();
 if (pm.load('c:/sample.jpg'))
     section.item('myPixmap').pixmap = pm;

Constructor & Destructor Documentation

bps::Pixmap::Pixmap ( String  aFileName)

Initializing constructor.

Parameters:
aFileNameThe picture file to load.

Member Function Documentation

Boolean bps::Pixmap::load ( String  aFileName)

Load a pixmap from a file.

The image type is detected automatically by the file contents.

Parameters:
aFileNameThe name of the file to load.
Returns:
True if successful.
Boolean bps::Pixmap::loadFromData ( ByteArray  aData)

Load a pixmap from memory data.

The image type is detected automatic by the data. This loader function will typically be used to load pictures stored in a database BLOB.

Parameters:
aDataThe data with the picture file contents to load.
Returns:
True if successful.
Boolean bps::Pixmap::save ( const QString &  aFileName)

Save pixmap to a file.

Parameters:
aFileNameThe file name to store the pixmap. The extension of the filename is used to determine the type (png, jpg, bmp, ...)
Returns:
True when successful.
ByteArray bps::Pixmap::saveToData ( const QString &  aFormat)

Save pixmap to in memory data in a file format.

Parameters:
aFormatThe file format (png, jpg, bmp, ...)
Returns:
The saved pixmap.
String bps::Pixmap::toString ( ) const
Returns:
Returns "Pixmap(width x height)"

Property Documentation

Number bps::Pixmap::depth [read]

The depth in bits.

 

Number bps::Pixmap::height [read]

The height in pixels.

 

Boolean bps::Pixmap::isNull [read]

True if the pixmap is empty.

 

Number bps::Pixmap::width [read]

The width in pixels.