BPS Script API  2.24.4
bps::Pixmap Class Reference

A wrapper for QPixmap. More...

Public Member Functions

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

Properties

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

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;
A wrapper for QPixmap.
Definition: bps.Pixmap.js:16
The bps extension is a namespace assembling general BPS properties and functions.
Definition: bps.AsyncIO.js:1

Constructor & Destructor Documentation

◆ Pixmap()

bps::Pixmap::Pixmap ( String  aFileName)

Initializing constructor.

Parameters
aFileNameThe picture file to load.

Member Function Documentation

◆ load()

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.

◆ loadFromData()

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.

◆ save()

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.

◆ saveToData()

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.

◆ toString()

String bps::Pixmap::toString ( ) const
Returns
Returns "Pixmap(width x height)"

Property Documentation

◆ depth

Number bps::Pixmap::depth
read

The depth in bits.

 

◆ height

Number bps::Pixmap::height
read

The height in pixels.

 

◆ isNull

Boolean bps::Pixmap::isNull
read

True if the pixmap is empty.

 

◆ width

Number bps::Pixmap::width
read

The width in pixels.

 


The documentation for this class was generated from the following file: