[][src]Struct qt_gui::QBitmap

#[repr(C)]
pub struct QBitmap { /* fields omitted */ }

The QBitmap class provides monochrome (1-bit depth) pixmaps.

C++ class: QBitmap.

C++ documentation:

The QBitmap class provides monochrome (1-bit depth) pixmaps.

The QBitmap class is a monochrome off-screen paint device used mainly for creating custom QCursor and QBrush objects, constructing QRegion objects, and for setting masks for pixmaps and widgets.

QBitmap is a QPixmap subclass ensuring a depth of 1, except for null objects which have a depth of 0. If a pixmap with a depth greater than 1 is assigned to a bitmap, the bitmap will be dithered automatically.

Use the QColor objects Qt::color0 and Qt::color1 when drawing on a QBitmap object (or a QPixmap object with depth 1).

Painting with Qt::color0 sets the bitmap bits to 0, and painting with Qt::color1 sets the bits to 1. For a bitmap, 0-bits indicate background (or transparent pixels) and 1-bits indicate foreground (or opaque pixels). Use the clear() function to set all the bits to Qt::color0. Note that using the Qt::black and Qt::white colors make no sense because the QColor::pixel() value is not necessarily 0 for black and 1 for white.

The QBitmap class provides the transformed() function returning a transformed copy of the bitmap; use the QTransform argument to translate, scale, shear, and rotate the bitmap. In addition, QBitmap provides the static fromData() function which returns a bitmap constructed from the given uchar data, and the static fromImage() function returning a converted copy of a QImage object.

Just like the QPixmap class, QBitmap is optimized by the use of implicit data sharing. For more information, see the Implicit Data Sharing documentation.

Methods

impl QBitmap[src]

pub unsafe fn clear(&mut self)[src]

Clears the bitmap, setting all its bits to Qt::color0.

Calls C++ function: void QBitmap::clear().

C++ documentation:

Clears the bitmap, setting all its bits to Qt::color0.

pub unsafe fn copy_from_q_bitmap(
    &mut self,
    other: impl CastInto<Ref<QBitmap>>
) -> MutRef<QBitmap>
[src]

Copy-assignment operator.

Calls C++ function: QBitmap& QBitmap::operator=(const QBitmap& other).

C++ documentation:

Copy-assignment operator.

pub unsafe fn copy_from_q_pixmap(
    &mut self,
    arg1: impl CastInto<Ref<QPixmap>>
) -> MutRef<QBitmap>
[src]

This is an overloaded function.

Calls C++ function: QBitmap& QBitmap::operator=(const QPixmap& arg1).

C++ documentation:

This is an overloaded function.

Assigns the given pixmap to this bitmap and returns a reference to this bitmap.

If the pixmap has a depth greater than 1, the resulting bitmap will be dithered automatically.

See also QPixmap::depth().

pub unsafe fn from_data_3a(
    size: impl CastInto<Ref<QSize>>,
    bits: impl CastInto<Ptr<c_uchar>>,
    mono_format: Format
) -> CppBox<QBitmap>
[src]

Constructs a bitmap with the given size, and sets the contents to the bits supplied.

Calls C++ function: static QBitmap QBitmap::fromData(const QSize& size, const unsigned char* bits, QImage::Format monoFormat = …).

C++ documentation:

Constructs a bitmap with the given size, and sets the contents to the bits supplied.

The bitmap data has to be byte aligned and provided in in the bit order specified by monoFormat. The mono format must be either QImage::Format_Mono or QImage::Format_MonoLSB. Use QImage::Format_Mono to specify data on the XBM format.

See also fromImage().

pub unsafe fn from_data_2a(
    size: impl CastInto<Ref<QSize>>,
    bits: impl CastInto<Ptr<c_uchar>>
) -> CppBox<QBitmap>
[src]

Constructs a bitmap with the given size, and sets the contents to the bits supplied.

Calls C++ function: static QBitmap QBitmap::fromData(const QSize& size, const unsigned char* bits).

C++ documentation:

Constructs a bitmap with the given size, and sets the contents to the bits supplied.

The bitmap data has to be byte aligned and provided in in the bit order specified by monoFormat. The mono format must be either QImage::Format_Mono or QImage::Format_MonoLSB. Use QImage::Format_Mono to specify data on the XBM format.

See also fromImage().

pub unsafe fn from_image_2a(
    image: impl CastInto<Ref<QImage>>,
    flags: QFlags<ImageConversionFlag>
) -> CppBox<QBitmap>
[src]

Returns a copy of the given image converted to a bitmap using the specified image conversion flags.

Calls C++ function: static QBitmap QBitmap::fromImage(const QImage& image, QFlags<Qt::ImageConversionFlag> flags = …).

C++ documentation:

Returns a copy of the given image converted to a bitmap using the specified image conversion flags.

See also fromData().

pub unsafe fn from_image_1a(
    image: impl CastInto<Ref<QImage>>
) -> CppBox<QBitmap>
[src]

Returns a copy of the given image converted to a bitmap using the specified image conversion flags.

Calls C++ function: static QBitmap QBitmap::fromImage(const QImage& image).

C++ documentation:

Returns a copy of the given image converted to a bitmap using the specified image conversion flags.

See also fromData().

pub unsafe fn new() -> CppBox<QBitmap>[src]

Constructs a null bitmap.

Calls C++ function: [constructor] void QBitmap::QBitmap().

C++ documentation:

Constructs a null bitmap.

See also QPixmap::isNull().

pub unsafe fn from_q_pixmap(
    arg1: impl CastInto<Ref<QPixmap>>
) -> CppBox<QBitmap>
[src]

Constructs a bitmap that is a copy of the given pixmap.

Calls C++ function: [constructor] void QBitmap::QBitmap(const QPixmap& arg1).

C++ documentation:

Constructs a bitmap that is a copy of the given pixmap.

If the pixmap has a depth greater than 1, the resulting bitmap will be dithered automatically.

See also QPixmap::depth(), fromImage(), and fromData().

pub unsafe fn from_2_int(w: c_int, h: c_int) -> CppBox<QBitmap>[src]

Constructs a bitmap with the given width and height. The pixels inside are uninitialized.

Calls C++ function: [constructor] void QBitmap::QBitmap(int w, int h).

C++ documentation:

Constructs a bitmap with the given width and height. The pixels inside are uninitialized.

See also clear().

pub unsafe fn from_q_size(arg1: impl CastInto<Ref<QSize>>) -> CppBox<QBitmap>[src]

Constructs a bitmap with the given size. The pixels in the bitmap are uninitialized.

Calls C++ function: [constructor] void QBitmap::QBitmap(const QSize& arg1).

C++ documentation:

Constructs a bitmap with the given size. The pixels in the bitmap are uninitialized.

See also clear().

pub unsafe fn from_q_string_char(
    file_name: impl CastInto<Ref<QString>>,
    format: impl CastInto<Ptr<c_char>>
) -> CppBox<QBitmap>
[src]

Constructs a bitmap from the file specified by the given fileName. If the file does not exist, or has an unknown format, the bitmap becomes a null bitmap.

Calls C++ function: [constructor] void QBitmap::QBitmap(const QString& fileName, const char* format = …).

C++ documentation:

Constructs a bitmap from the file specified by the given fileName. If the file does not exist, or has an unknown format, the bitmap becomes a null bitmap.

The fileName and format parameters are passed on to the QPixmap::load() function. If the file format uses more than 1 bit per pixel, the resulting bitmap will be dithered automatically.

See also QPixmap::isNull() and QImageReader::imageFormat().

pub unsafe fn from_q_string(
    file_name: impl CastInto<Ref<QString>>
) -> CppBox<QBitmap>
[src]

Constructs a bitmap from the file specified by the given fileName. If the file does not exist, or has an unknown format, the bitmap becomes a null bitmap.

Calls C++ function: [constructor] void QBitmap::QBitmap(const QString& fileName).

C++ documentation:

Constructs a bitmap from the file specified by the given fileName. If the file does not exist, or has an unknown format, the bitmap becomes a null bitmap.

The fileName and format parameters are passed on to the QPixmap::load() function. If the file format uses more than 1 bit per pixel, the resulting bitmap will be dithered automatically.

See also QPixmap::isNull() and QImageReader::imageFormat().

pub unsafe fn new_copy(other: impl CastInto<Ref<QBitmap>>) -> CppBox<QBitmap>[src]

Copy constructor.

Calls C++ function: [constructor] void QBitmap::QBitmap(const QBitmap& other).

C++ documentation:

Copy constructor.

pub unsafe fn swap(&mut self, other: impl CastInto<MutRef<QBitmap>>)[src]

Swaps bitmap other with this bitmap. This operation is very fast and never fails.

Calls C++ function: void QBitmap::swap(QBitmap& other).

C++ documentation:

Swaps bitmap other with this bitmap. This operation is very fast and never fails.

This function was introduced in Qt 4.8.

pub unsafe fn to_q_variant(&self) -> CppBox<QVariant>[src]

Returns the bitmap as a QVariant.

Calls C++ function: QVariant QBitmap::operator QVariant() const.

C++ documentation:

Returns the bitmap as a QVariant.

pub unsafe fn transformed_q_matrix(
    &self,
    arg1: impl CastInto<Ref<QMatrix>>
) -> CppBox<QBitmap>
[src]

Returns a copy of this bitmap, transformed according to the given matrix.

Calls C++ function: QBitmap QBitmap::transformed(const QMatrix& arg1) const.

Warning: no exact match found in C++ documentation. Below is the C++ documentation for QBitmap QBitmap::transformed(const QTransform &matrix) const:

Returns a copy of this bitmap, transformed according to the given matrix.

See also QPixmap::transformed().

pub unsafe fn transformed_q_transform(
    &self,
    matrix: impl CastInto<Ref<QTransform>>
) -> CppBox<QBitmap>
[src]

Returns a copy of this bitmap, transformed according to the given matrix.

Calls C++ function: QBitmap QBitmap::transformed(const QTransform& matrix) const.

C++ documentation:

Returns a copy of this bitmap, transformed according to the given matrix.

See also QPixmap::transformed().

Methods from Deref<Target = QPixmap>

pub unsafe fn cache_key(&self) -> i64[src]

Returns a number that identifies this QPixmap. Distinct QPixmap objects can only have the same cache key if they refer to the same contents.

Calls C++ function: qint64 QPixmap::cacheKey() const.

C++ documentation:

Returns a number that identifies this QPixmap. Distinct QPixmap objects can only have the same cache key if they refer to the same contents.

The cacheKey() will change when the pixmap is altered.

pub unsafe fn convert_from_image_2a(
    &mut self,
    img: impl CastInto<Ref<QImage>>,
    flags: QFlags<ImageConversionFlag>
) -> bool
[src]

Replaces this pixmap's data with the given image using the specified flags to control the conversion. The flags argument is a bitwise-OR of the Qt::ImageConversionFlags. Passing 0 for flags sets all the default options. Returns true if the result is that this pixmap is not null.

Calls C++ function: bool QPixmap::convertFromImage(const QImage& img, QFlags<Qt::ImageConversionFlag> flags = …).

C++ documentation:

Replaces this pixmap's data with the given image using the specified flags to control the conversion. The flags argument is a bitwise-OR of the Qt::ImageConversionFlags. Passing 0 for flags sets all the default options. Returns true if the result is that this pixmap is not null.

Note: this function was part of Qt 3 support in Qt 4.6 and earlier. It has been promoted to official API status in 4.7 to support updating the pixmap's image without creating a new QPixmap as fromImage() would.

This function was introduced in Qt 4.7.

See also fromImage().

pub unsafe fn convert_from_image_1a(
    &mut self,
    img: impl CastInto<Ref<QImage>>
) -> bool
[src]

Replaces this pixmap's data with the given image using the specified flags to control the conversion. The flags argument is a bitwise-OR of the Qt::ImageConversionFlags. Passing 0 for flags sets all the default options. Returns true if the result is that this pixmap is not null.

Calls C++ function: bool QPixmap::convertFromImage(const QImage& img).

C++ documentation:

Replaces this pixmap's data with the given image using the specified flags to control the conversion. The flags argument is a bitwise-OR of the Qt::ImageConversionFlags. Passing 0 for flags sets all the default options. Returns true if the result is that this pixmap is not null.

Note: this function was part of Qt 3 support in Qt 4.6 and earlier. It has been promoted to official API status in 4.7 to support updating the pixmap's image without creating a new QPixmap as fromImage() would.

This function was introduced in Qt 4.7.

See also fromImage().

pub unsafe fn copy_4a(
    &self,
    x: c_int,
    y: c_int,
    width: c_int,
    height: c_int
) -> CppBox<QPixmap>
[src]

This is an overloaded function.

Calls C++ function: QPixmap QPixmap::copy(int x, int y, int width, int height) const.

C++ documentation:

This is an overloaded function.

Returns a deep copy of the subset of the pixmap that is specified by the rectangle QRect( x, y, width, height).

pub unsafe fn copy_1a(&self, rect: impl CastInto<Ref<QRect>>) -> CppBox<QPixmap>[src]

Returns a deep copy of the subset of the pixmap that is specified by the given rectangle. For more information on deep copies, see the Implicit Data Sharing documentation.

Calls C++ function: QPixmap QPixmap::copy(const QRect& rect = …) const.

C++ documentation:

Returns a deep copy of the subset of the pixmap that is specified by the given rectangle. For more information on deep copies, see the Implicit Data Sharing documentation.

If the given rectangle is empty, the whole image is copied.

See also operator=(), QPixmap(), and Pixmap Transformations.

pub unsafe fn copy_0a(&self) -> CppBox<QPixmap>[src]

Returns a deep copy of the subset of the pixmap that is specified by the given rectangle. For more information on deep copies, see the Implicit Data Sharing documentation.

Calls C++ function: QPixmap QPixmap::copy() const.

C++ documentation:

Returns a deep copy of the subset of the pixmap that is specified by the given rectangle. For more information on deep copies, see the Implicit Data Sharing documentation.

If the given rectangle is empty, the whole image is copied.

See also operator=(), QPixmap(), and Pixmap Transformations.

pub unsafe fn copy_from(
    &mut self,
    arg1: impl CastInto<Ref<QPixmap>>
) -> MutRef<QPixmap>
[src]

Assigns the given pixmap to this pixmap and returns a reference to this pixmap.

Calls C++ function: QPixmap& QPixmap::operator=(const QPixmap& arg1).

C++ documentation:

Assigns the given pixmap to this pixmap and returns a reference to this pixmap.

See also copy() and QPixmap().

pub unsafe fn create_heuristic_mask_1a(
    &self,
    clip_tight: bool
) -> CppBox<QBitmap>
[src]

Creates and returns a heuristic mask for this pixmap.

Calls C++ function: QBitmap QPixmap::createHeuristicMask(bool clipTight = …) const.

C++ documentation:

Creates and returns a heuristic mask for this pixmap.

The function works by selecting a color from one of the corners and then chipping away pixels of that color, starting at all the edges. If clipTight is true (the default) the mask is just large enough to cover the pixels; otherwise, the mask is larger than the data pixels.

The mask may not be perfect but it should be reasonable, so you can do things such as the following:

QPixmap myPixmap; myPixmap.setMask(myPixmap.createHeuristicMask());

This function is slow because it involves converting to/from a QImage, and non-trivial computations.

See also QImage::createHeuristicMask() and createMaskFromColor().

pub unsafe fn create_heuristic_mask_0a(&self) -> CppBox<QBitmap>[src]

Creates and returns a heuristic mask for this pixmap.

Calls C++ function: QBitmap QPixmap::createHeuristicMask() const.

C++ documentation:

Creates and returns a heuristic mask for this pixmap.

The function works by selecting a color from one of the corners and then chipping away pixels of that color, starting at all the edges. If clipTight is true (the default) the mask is just large enough to cover the pixels; otherwise, the mask is larger than the data pixels.

The mask may not be perfect but it should be reasonable, so you can do things such as the following:

QPixmap myPixmap; myPixmap.setMask(myPixmap.createHeuristicMask());

This function is slow because it involves converting to/from a QImage, and non-trivial computations.

See also QImage::createHeuristicMask() and createMaskFromColor().

pub unsafe fn create_mask_from_color_2a(
    &self,
    mask_color: impl CastInto<Ref<QColor>>,
    mode: MaskMode
) -> CppBox<QBitmap>
[src]

Creates and returns a mask for this pixmap based on the given maskColor. If the mode is Qt::MaskInColor, all pixels matching the maskColor will be transparent. If mode is Qt::MaskOutColor, all pixels matching the maskColor will be opaque.

Calls C++ function: QBitmap QPixmap::createMaskFromColor(const QColor& maskColor, Qt::MaskMode mode = …) const.

C++ documentation:

Creates and returns a mask for this pixmap based on the given maskColor. If the mode is Qt::MaskInColor, all pixels matching the maskColor will be transparent. If mode is Qt::MaskOutColor, all pixels matching the maskColor will be opaque.

This function is slow because it involves converting to/from a QImage.

See also createHeuristicMask() and QImage::createMaskFromColor().

pub unsafe fn create_mask_from_color_1a(
    &self,
    mask_color: impl CastInto<Ref<QColor>>
) -> CppBox<QBitmap>
[src]

Creates and returns a mask for this pixmap based on the given maskColor. If the mode is Qt::MaskInColor, all pixels matching the maskColor will be transparent. If mode is Qt::MaskOutColor, all pixels matching the maskColor will be opaque.

Calls C++ function: QBitmap QPixmap::createMaskFromColor(const QColor& maskColor) const.

C++ documentation:

Creates and returns a mask for this pixmap based on the given maskColor. If the mode is Qt::MaskInColor, all pixels matching the maskColor will be transparent. If mode is Qt::MaskOutColor, all pixels matching the maskColor will be opaque.

This function is slow because it involves converting to/from a QImage.

See also createHeuristicMask() and QImage::createMaskFromColor().

pub unsafe fn depth(&self) -> c_int[src]

Returns the depth of the pixmap.

Calls C++ function: int QPixmap::depth() const.

C++ documentation:

Returns the 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.

See also defaultDepth() and Pixmap Information.

pub unsafe fn detach(&mut self)[src]

Detaches the pixmap from shared pixmap data.

Calls C++ function: void QPixmap::detach().

C++ documentation:

Detaches the pixmap from shared pixmap data.

A pixmap is automatically detached by Qt whenever its contents are about to change. This is done in almost all QPixmap member functions that modify the pixmap (fill(), fromImage(), load(), etc.), and in QPainter::begin() on a pixmap.

There are two exceptions in which detach() must be called explicitly, that is when calling the handle() or the x11PictureHandle() function (only available on X11). Otherwise, any modifications done using system calls, will be performed on the shared data.

The detach() function returns immediately if there is just a single reference or if the pixmap has not been initialized yet.

pub unsafe fn dev_type(&self) -> c_int[src]

Calls C++ function: virtual int QPixmap::devType() const.

pub unsafe fn device_pixel_ratio(&self) -> c_double[src]

Returns the device pixel ratio for the pixmap. This is the ratio between device pixels and device independent pixels.

Calls C++ function: double QPixmap::devicePixelRatio() const.

C++ documentation:

Returns the device pixel ratio for the pixmap. This is the ratio between device pixels and device independent pixels.

Use this function when calculating layout geometry based on the pixmap size: QSize layoutSize = image.size() / image.devicePixelRatio()

The default value is 1.0.

See also setDevicePixelRatio() and QImageReader.

pub unsafe fn fill_1a(&mut self, fill_color: impl CastInto<Ref<QColor>>)[src]

Use QPainter or the fill(QColor) overload instead.

Calls C++ function: void QPixmap::fill(const QColor& fillColor = …).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for void QPixmap::fill(const QPaintDevice *device, const QPoint &p):

Use QPainter or the fill(QColor) overload instead.

pub unsafe fn fill_2a(
    &mut self,
    device: impl CastInto<Ptr<QPaintDevice>>,
    ofs: impl CastInto<Ref<QPoint>>
)
[src]

Use QPainter or the fill(QColor) overload instead.

Calls C++ function: void QPixmap::fill(const QPaintDevice* device, const QPoint& ofs).

C++ documentation:

Use QPainter or the fill(QColor) overload instead.

pub unsafe fn fill_3a(
    &mut self,
    device: impl CastInto<Ptr<QPaintDevice>>,
    xofs: c_int,
    yofs: c_int
)
[src]

Use QPainter or the fill(QColor) overload instead.

Calls C++ function: void QPixmap::fill(const QPaintDevice* device, int xofs, int yofs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for void QPixmap::fill(const QPaintDevice *device, const QPoint &p):

Use QPainter or the fill(QColor) overload instead.

pub unsafe fn fill_0a(&mut self)[src]

Use QPainter or the fill(QColor) overload instead.

Calls C++ function: void QPixmap::fill().

Warning: no exact match found in C++ documentation. Below is the C++ documentation for void QPixmap::fill(const QPaintDevice *device, const QPoint &p):

Use QPainter or the fill(QColor) overload instead.

pub unsafe fn has_alpha(&self) -> bool[src]

Returns true if this pixmap has an alpha channel, or has a mask, otherwise returns false.

Calls C++ function: bool QPixmap::hasAlpha() const.

C++ documentation:

Returns true if this pixmap has an alpha channel, or has a mask, otherwise returns false.

See also hasAlphaChannel() and mask().

pub unsafe fn has_alpha_channel(&self) -> bool[src]

Returns true if the pixmap has a format that respects the alpha channel, otherwise returns false.

Calls C++ function: bool QPixmap::hasAlphaChannel() const.

C++ documentation:

Returns true if the pixmap has a format that respects the alpha channel, otherwise returns false.

See also hasAlpha().

pub unsafe fn height(&self) -> c_int[src]

Returns the height of the pixmap.

Calls C++ function: int QPixmap::height() const.

C++ documentation:

Returns the height of the pixmap.

See also size() and Pixmap Information.

pub unsafe fn is_detached(&self) -> bool[src]

Calls C++ function: bool QPixmap::isDetached() const.

pub unsafe fn is_null(&self) -> bool[src]

Returns true if this is a null pixmap; otherwise returns false.

Calls C++ function: bool QPixmap::isNull() const.

C++ documentation:

Returns true if this is a null pixmap; otherwise returns false.

A null pixmap has zero width, zero height and no contents. You cannot draw in a null pixmap.

pub unsafe fn is_q_bitmap(&self) -> bool[src]

Returns true if this is a QBitmap; otherwise returns false.

Calls C++ function: bool QPixmap::isQBitmap() const.

C++ documentation:

Returns true if this is a QBitmap; otherwise returns false.

pub unsafe fn load_3a(
    &mut self,
    file_name: impl CastInto<Ref<QString>>,
    format: impl CastInto<Ptr<c_char>>,
    flags: QFlags<ImageConversionFlag>
) -> bool
[src]

Loads a pixmap from the file with the given fileName. Returns true if the pixmap was successfully loaded; otherwise invalidates the pixmap and returns false.

Calls C++ function: bool QPixmap::load(const QString& fileName, const char* format = …, QFlags<Qt::ImageConversionFlag> flags = …).

C++ documentation:

Loads a pixmap from the file with the given fileName. Returns true if the pixmap was successfully loaded; otherwise invalidates the pixmap and returns false.

The loader attempts to read the pixmap using the specified format. If the format is not specified (which is the default), the loader probes the file for a header to guess the file format.

The file name can either refer to an actual file on disk or to one of the application's embedded resources. See the Resource System overview for details on how to embed pixmaps and other resource files in the application's executable.

If the data needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to control the conversion.

Note that QPixmaps are automatically added to the QPixmapCache when loaded from a file; the key used is internal and can not be acquired.

See also loadFromData() and Reading and Writing Image Files.

pub unsafe fn load_2a(
    &mut self,
    file_name: impl CastInto<Ref<QString>>,
    format: impl CastInto<Ptr<c_char>>
) -> bool
[src]

Loads a pixmap from the file with the given fileName. Returns true if the pixmap was successfully loaded; otherwise invalidates the pixmap and returns false.

Calls C++ function: bool QPixmap::load(const QString& fileName, const char* format = …).

C++ documentation:

Loads a pixmap from the file with the given fileName. Returns true if the pixmap was successfully loaded; otherwise invalidates the pixmap and returns false.

The loader attempts to read the pixmap using the specified format. If the format is not specified (which is the default), the loader probes the file for a header to guess the file format.

The file name can either refer to an actual file on disk or to one of the application's embedded resources. See the Resource System overview for details on how to embed pixmaps and other resource files in the application's executable.

If the data needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to control the conversion.

Note that QPixmaps are automatically added to the QPixmapCache when loaded from a file; the key used is internal and can not be acquired.

See also loadFromData() and Reading and Writing Image Files.

pub unsafe fn load_1a(&mut self, file_name: impl CastInto<Ref<QString>>) -> bool[src]

Loads a pixmap from the file with the given fileName. Returns true if the pixmap was successfully loaded; otherwise invalidates the pixmap and returns false.

Calls C++ function: bool QPixmap::load(const QString& fileName).

C++ documentation:

Loads a pixmap from the file with the given fileName. Returns true if the pixmap was successfully loaded; otherwise invalidates the pixmap and returns false.

The loader attempts to read the pixmap using the specified format. If the format is not specified (which is the default), the loader probes the file for a header to guess the file format.

The file name can either refer to an actual file on disk or to one of the application's embedded resources. See the Resource System overview for details on how to embed pixmaps and other resource files in the application's executable.

If the data needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to control the conversion.

Note that QPixmaps are automatically added to the QPixmapCache when loaded from a file; the key used is internal and can not be acquired.

See also loadFromData() and Reading and Writing Image Files.

pub unsafe fn load_from_data_uchar_uint_char_q_flags_image_conversion_flag(
    &mut self,
    buf: impl CastInto<Ptr<c_uchar>>,
    len: c_uint,
    format: impl CastInto<Ptr<c_char>>,
    flags: QFlags<ImageConversionFlag>
) -> bool
[src]

Loads a pixmap from the len first bytes of the given binary data. Returns true if the pixmap was loaded successfully; otherwise invalidates the pixmap and returns false.

Calls C++ function: bool QPixmap::loadFromData(const unsigned char* buf, unsigned int len, const char* format = …, QFlags<Qt::ImageConversionFlag> flags = …).

C++ documentation:

Loads a pixmap from the len first bytes of the given binary data. Returns true if the pixmap was loaded successfully; otherwise invalidates the pixmap and returns false.

The loader attempts to read the pixmap using the specified format. If the format is not specified (which is the default), the loader probes the file for a header to guess the file format.

If the data needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to control the conversion.

See also load() and Reading and Writing Image Files.

pub unsafe fn load_from_data_q_byte_array_char_q_flags_image_conversion_flag(
    &mut self,
    data: impl CastInto<Ref<QByteArray>>,
    format: impl CastInto<Ptr<c_char>>,
    flags: QFlags<ImageConversionFlag>
) -> bool
[src]

This is an overloaded function.

Calls C++ function: bool QPixmap::loadFromData(const QByteArray& data, const char* format = …, QFlags<Qt::ImageConversionFlag> flags = …).

C++ documentation:

This is an overloaded function.

Loads a pixmap from the binary data using the specified format and conversion flags.

pub unsafe fn load_from_data_uchar_uint_char(
    &mut self,
    buf: impl CastInto<Ptr<c_uchar>>,
    len: c_uint,
    format: impl CastInto<Ptr<c_char>>
) -> bool
[src]

Loads a pixmap from the len first bytes of the given binary data. Returns true if the pixmap was loaded successfully; otherwise invalidates the pixmap and returns false.

Calls C++ function: bool QPixmap::loadFromData(const unsigned char* buf, unsigned int len, const char* format = …).

C++ documentation:

Loads a pixmap from the len first bytes of the given binary data. Returns true if the pixmap was loaded successfully; otherwise invalidates the pixmap and returns false.

The loader attempts to read the pixmap using the specified format. If the format is not specified (which is the default), the loader probes the file for a header to guess the file format.

If the data needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to control the conversion.

See also load() and Reading and Writing Image Files.

pub unsafe fn load_from_data_uchar_uint(
    &mut self,
    buf: impl CastInto<Ptr<c_uchar>>,
    len: c_uint
) -> bool
[src]

Loads a pixmap from the len first bytes of the given binary data. Returns true if the pixmap was loaded successfully; otherwise invalidates the pixmap and returns false.

Calls C++ function: bool QPixmap::loadFromData(const unsigned char* buf, unsigned int len).

C++ documentation:

Loads a pixmap from the len first bytes of the given binary data. Returns true if the pixmap was loaded successfully; otherwise invalidates the pixmap and returns false.

The loader attempts to read the pixmap using the specified format. If the format is not specified (which is the default), the loader probes the file for a header to guess the file format.

If the data needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to control the conversion.

See also load() and Reading and Writing Image Files.

pub unsafe fn load_from_data_q_byte_array_char(
    &mut self,
    data: impl CastInto<Ref<QByteArray>>,
    format: impl CastInto<Ptr<c_char>>
) -> bool
[src]

This is an overloaded function.

Calls C++ function: bool QPixmap::loadFromData(const QByteArray& data, const char* format = …).

C++ documentation:

This is an overloaded function.

Loads a pixmap from the binary data using the specified format and conversion flags.

pub unsafe fn load_from_data_q_byte_array(
    &mut self,
    data: impl CastInto<Ref<QByteArray>>
) -> bool
[src]

This is an overloaded function.

Calls C++ function: bool QPixmap::loadFromData(const QByteArray& data).

C++ documentation:

This is an overloaded function.

Loads a pixmap from the binary data using the specified format and conversion flags.

pub unsafe fn mask(&self) -> CppBox<QBitmap>[src]

Extracts a bitmap mask from the pixmap's alpha channel.

Calls C++ function: QBitmap QPixmap::mask() const.

C++ documentation:

Extracts a bitmap mask from the pixmap's alpha channel.

Warning: This is potentially an expensive operation. The mask of the pixmap is extracted dynamically from the pixeldata.

See also setMask() and Pixmap Information.

pub unsafe fn paint_engine(&self) -> MutPtr<QPaintEngine>[src]

Calls C++ function: virtual QPaintEngine* QPixmap::paintEngine() const.

pub unsafe fn rect(&self) -> CppBox<QRect>[src]

Returns the pixmap's enclosing rectangle.

Calls C++ function: QRect QPixmap::rect() const.

C++ documentation:

Returns the pixmap's enclosing rectangle.

See also Pixmap Information.

pub unsafe fn save_q_string_char_int(
    &self,
    file_name: impl CastInto<Ref<QString>>,
    format: impl CastInto<Ptr<c_char>>,
    quality: c_int
) -> bool
[src]

Saves the pixmap to the file with the given fileName using the specified image file format and quality factor. Returns true if successful; otherwise returns false.

Calls C++ function: bool QPixmap::save(const QString& fileName, const char* format = …, int quality = …) const.

C++ documentation:

Saves the pixmap to the file with the given fileName using the specified image file format and quality factor. Returns true if successful; otherwise returns false.

The quality factor must be in the range [0,100] or -1. Specify 0 to obtain small compressed files, 100 for large uncompressed files, and -1 to use the default settings.

If format is 0, an image format will be chosen from fileName's suffix.

See also Reading and Writing Image Files.

pub unsafe fn save_q_io_device_char_int(
    &self,
    device: impl CastInto<MutPtr<QIODevice>>,
    format: impl CastInto<Ptr<c_char>>,
    quality: c_int
) -> bool
[src]

This is an overloaded function.

Calls C++ function: bool QPixmap::save(QIODevice* device, const char* format = …, int quality = …) const.

C++ documentation:

This is an overloaded function.

This function writes a QPixmap to the given device using the specified image file format and quality factor. This can be used, for example, to save a pixmap directly into a QByteArray:

QPixmap pixmap; QByteArray bytes; QBuffer buffer(&bytes); buffer.open(QIODevice::WriteOnly); pixmap.save(&buffer, "PNG"); // writes pixmap into bytes in PNG format

pub unsafe fn save_q_string_char(
    &self,
    file_name: impl CastInto<Ref<QString>>,
    format: impl CastInto<Ptr<c_char>>
) -> bool
[src]

Saves the pixmap to the file with the given fileName using the specified image file format and quality factor. Returns true if successful; otherwise returns false.

Calls C++ function: bool QPixmap::save(const QString& fileName, const char* format = …) const.

C++ documentation:

Saves the pixmap to the file with the given fileName using the specified image file format and quality factor. Returns true if successful; otherwise returns false.

The quality factor must be in the range [0,100] or -1. Specify 0 to obtain small compressed files, 100 for large uncompressed files, and -1 to use the default settings.

If format is 0, an image format will be chosen from fileName's suffix.

See also Reading and Writing Image Files.

pub unsafe fn save_q_string(
    &self,
    file_name: impl CastInto<Ref<QString>>
) -> bool
[src]

Saves the pixmap to the file with the given fileName using the specified image file format and quality factor. Returns true if successful; otherwise returns false.

Calls C++ function: bool QPixmap::save(const QString& fileName) const.

C++ documentation:

Saves the pixmap to the file with the given fileName using the specified image file format and quality factor. Returns true if successful; otherwise returns false.

The quality factor must be in the range [0,100] or -1. Specify 0 to obtain small compressed files, 100 for large uncompressed files, and -1 to use the default settings.

If format is 0, an image format will be chosen from fileName's suffix.

See also Reading and Writing Image Files.

pub unsafe fn save_q_io_device_char(
    &self,
    device: impl CastInto<MutPtr<QIODevice>>,
    format: impl CastInto<Ptr<c_char>>
) -> bool
[src]

This is an overloaded function.

Calls C++ function: bool QPixmap::save(QIODevice* device, const char* format = …) const.

C++ documentation:

This is an overloaded function.

This function writes a QPixmap to the given device using the specified image file format and quality factor. This can be used, for example, to save a pixmap directly into a QByteArray:

QPixmap pixmap; QByteArray bytes; QBuffer buffer(&bytes); buffer.open(QIODevice::WriteOnly); pixmap.save(&buffer, "PNG"); // writes pixmap into bytes in PNG format

pub unsafe fn save_q_io_device(
    &self,
    device: impl CastInto<MutPtr<QIODevice>>
) -> bool
[src]

This is an overloaded function.

Calls C++ function: bool QPixmap::save(QIODevice* device) const.

C++ documentation:

This is an overloaded function.

This function writes a QPixmap to the given device using the specified image file format and quality factor. This can be used, for example, to save a pixmap directly into a QByteArray:

QPixmap pixmap; QByteArray bytes; QBuffer buffer(&bytes); buffer.open(QIODevice::WriteOnly); pixmap.save(&buffer, "PNG"); // writes pixmap into bytes in PNG format

pub unsafe fn scaled_2_int_aspect_ratio_mode_transformation_mode(
    &self,
    w: c_int,
    h: c_int,
    aspect_mode: AspectRatioMode,
    mode: TransformationMode
) -> CppBox<QPixmap>
[src]

This is an overloaded function.

Calls C++ function: QPixmap QPixmap::scaled(int w, int h, Qt::AspectRatioMode aspectMode = …, Qt::TransformationMode mode = …) const.

C++ documentation:

This is an overloaded function.

Returns a copy of the pixmap scaled to a rectangle with the given width and height according to the given aspectRatioMode and transformMode.

If either the width or the height is zero or negative, this function returns a null pixmap.

pub unsafe fn scaled_q_size_aspect_ratio_mode_transformation_mode(
    &self,
    s: impl CastInto<Ref<QSize>>,
    aspect_mode: AspectRatioMode,
    mode: TransformationMode
) -> CppBox<QPixmap>
[src]

Scales the pixmap to the given size, using the aspect ratio and transformation modes specified by aspectRatioMode and transformMode.

Calls C++ function: QPixmap QPixmap::scaled(const QSize& s, Qt::AspectRatioMode aspectMode = …, Qt::TransformationMode mode = …) const.

C++ documentation:

Scales the pixmap to the given size, using the aspect ratio and transformation modes specified by aspectRatioMode and transformMode.

  • If aspectRatioMode is Qt::IgnoreAspectRatio, the pixmap is scaled to size.
  • If aspectRatioMode is Qt::KeepAspectRatio, the pixmap is scaled to a rectangle as large as possible inside size, preserving the aspect ratio.
  • If aspectRatioMode is Qt::KeepAspectRatioByExpanding, the pixmap is scaled to a rectangle as small as possible outside size, preserving the aspect ratio.

If the given size is empty, this function returns a null pixmap.

In some cases it can be more beneficial to draw the pixmap to a painter with a scale set rather than scaling the pixmap. This is the case when the painter is for instance based on OpenGL or when the scale factor changes rapidly.

See also isNull() and Pixmap Transformations.

pub unsafe fn scaled_2_int_aspect_ratio_mode(
    &self,
    w: c_int,
    h: c_int,
    aspect_mode: AspectRatioMode
) -> CppBox<QPixmap>
[src]

This is an overloaded function.

Calls C++ function: QPixmap QPixmap::scaled(int w, int h, Qt::AspectRatioMode aspectMode = …) const.

C++ documentation:

This is an overloaded function.

Returns a copy of the pixmap scaled to a rectangle with the given width and height according to the given aspectRatioMode and transformMode.

If either the width or the height is zero or negative, this function returns a null pixmap.

pub unsafe fn scaled_2_int(&self, w: c_int, h: c_int) -> CppBox<QPixmap>[src]

This is an overloaded function.

Calls C++ function: QPixmap QPixmap::scaled(int w, int h) const.

C++ documentation:

This is an overloaded function.

Returns a copy of the pixmap scaled to a rectangle with the given width and height according to the given aspectRatioMode and transformMode.

If either the width or the height is zero or negative, this function returns a null pixmap.

pub unsafe fn scaled_q_size_aspect_ratio_mode(
    &self,
    s: impl CastInto<Ref<QSize>>,
    aspect_mode: AspectRatioMode
) -> CppBox<QPixmap>
[src]

Scales the pixmap to the given size, using the aspect ratio and transformation modes specified by aspectRatioMode and transformMode.

Calls C++ function: QPixmap QPixmap::scaled(const QSize& s, Qt::AspectRatioMode aspectMode = …) const.

C++ documentation:

Scales the pixmap to the given size, using the aspect ratio and transformation modes specified by aspectRatioMode and transformMode.

  • If aspectRatioMode is Qt::IgnoreAspectRatio, the pixmap is scaled to size.
  • If aspectRatioMode is Qt::KeepAspectRatio, the pixmap is scaled to a rectangle as large as possible inside size, preserving the aspect ratio.
  • If aspectRatioMode is Qt::KeepAspectRatioByExpanding, the pixmap is scaled to a rectangle as small as possible outside size, preserving the aspect ratio.

If the given size is empty, this function returns a null pixmap.

In some cases it can be more beneficial to draw the pixmap to a painter with a scale set rather than scaling the pixmap. This is the case when the painter is for instance based on OpenGL or when the scale factor changes rapidly.

See also isNull() and Pixmap Transformations.

pub unsafe fn scaled_q_size(
    &self,
    s: impl CastInto<Ref<QSize>>
) -> CppBox<QPixmap>
[src]

Scales the pixmap to the given size, using the aspect ratio and transformation modes specified by aspectRatioMode and transformMode.

Calls C++ function: QPixmap QPixmap::scaled(const QSize& s) const.

C++ documentation:

Scales the pixmap to the given size, using the aspect ratio and transformation modes specified by aspectRatioMode and transformMode.

  • If aspectRatioMode is Qt::IgnoreAspectRatio, the pixmap is scaled to size.
  • If aspectRatioMode is Qt::KeepAspectRatio, the pixmap is scaled to a rectangle as large as possible inside size, preserving the aspect ratio.
  • If aspectRatioMode is Qt::KeepAspectRatioByExpanding, the pixmap is scaled to a rectangle as small as possible outside size, preserving the aspect ratio.

If the given size is empty, this function returns a null pixmap.

In some cases it can be more beneficial to draw the pixmap to a painter with a scale set rather than scaling the pixmap. This is the case when the painter is for instance based on OpenGL or when the scale factor changes rapidly.

See also isNull() and Pixmap Transformations.

pub unsafe fn scaled_to_height_2a(
    &self,
    h: c_int,
    mode: TransformationMode
) -> CppBox<QPixmap>
[src]

Returns a scaled copy of the image. The returned image is scaled to the given height using the specified transformation mode. The width of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved.

Calls C++ function: QPixmap QPixmap::scaledToHeight(int h, Qt::TransformationMode mode = …) const.

C++ documentation:

Returns a scaled copy of the image. The returned image is scaled to the given height using the specified transformation mode. The width of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved.

If height is 0 or negative, a null pixmap is returned.

See also isNull() and Pixmap Transformations.

pub unsafe fn scaled_to_height_1a(&self, h: c_int) -> CppBox<QPixmap>[src]

Returns a scaled copy of the image. The returned image is scaled to the given height using the specified transformation mode. The width of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved.

Calls C++ function: QPixmap QPixmap::scaledToHeight(int h) const.

C++ documentation:

Returns a scaled copy of the image. The returned image is scaled to the given height using the specified transformation mode. The width of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved.

If height is 0 or negative, a null pixmap is returned.

See also isNull() and Pixmap Transformations.

pub unsafe fn scaled_to_width_2a(
    &self,
    w: c_int,
    mode: TransformationMode
) -> CppBox<QPixmap>
[src]

Returns a scaled copy of the image. The returned image is scaled to the given width using the specified transformation mode. The height of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved.

Calls C++ function: QPixmap QPixmap::scaledToWidth(int w, Qt::TransformationMode mode = …) const.

C++ documentation:

Returns a scaled copy of the image. The returned image is scaled to the given width using the specified transformation mode. The height of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved.

If width is 0 or negative, a null pixmap is returned.

See also isNull() and Pixmap Transformations.

pub unsafe fn scaled_to_width_1a(&self, w: c_int) -> CppBox<QPixmap>[src]

Returns a scaled copy of the image. The returned image is scaled to the given width using the specified transformation mode. The height of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved.

Calls C++ function: QPixmap QPixmap::scaledToWidth(int w) const.

C++ documentation:

Returns a scaled copy of the image. The returned image is scaled to the given width using the specified transformation mode. The height of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved.

If width is 0 or negative, a null pixmap is returned.

See also isNull() and Pixmap Transformations.

pub unsafe fn scroll_7a(
    &mut self,
    dx: c_int,
    dy: c_int,
    x: c_int,
    y: c_int,
    width: c_int,
    height: c_int,
    exposed: impl CastInto<MutPtr<QRegion>>
)
[src]

This convenience function is equivalent to calling QPixmap::scroll(dx, dy, QRect(x, y, width, height), exposed).

Calls C++ function: void QPixmap::scroll(int dx, int dy, int x, int y, int width, int height, QRegion* exposed = …).

C++ documentation:

This convenience function is equivalent to calling QPixmap::scroll(dx, dy, QRect(x, y, width, height), exposed).

This function was introduced in Qt 4.6.

See also QWidget::scroll() and QGraphicsItem::scroll().

pub unsafe fn scroll_4a(
    &mut self,
    dx: c_int,
    dy: c_int,
    rect: impl CastInto<Ref<QRect>>,
    exposed: impl CastInto<MutPtr<QRegion>>
)
[src]

Scrolls the area rect of this pixmap by (dx, dy). The exposed region is left unchanged. You can optionally pass a pointer to an empty QRegion to get the region that is exposed by the scroll operation.

Calls C++ function: void QPixmap::scroll(int dx, int dy, const QRect& rect, QRegion* exposed = …).

C++ documentation:

Scrolls the area rect of this pixmap by (dx, dy). The exposed region is left unchanged. You can optionally pass a pointer to an empty QRegion to get the region that is exposed by the scroll operation.


  QPixmap pixmap("background.png");
  QRegion exposed;
  pixmap.scroll(10, 10, pixmap.rect(), &exposed);

You cannot scroll while there is an active painter on the pixmap.

This function was introduced in Qt 4.6.

See also QWidget::scroll() and QGraphicsItem::scroll().

pub unsafe fn scroll_6a(
    &mut self,
    dx: c_int,
    dy: c_int,
    x: c_int,
    y: c_int,
    width: c_int,
    height: c_int
)
[src]

This convenience function is equivalent to calling QPixmap::scroll(dx, dy, QRect(x, y, width, height), exposed).

Calls C++ function: void QPixmap::scroll(int dx, int dy, int x, int y, int width, int height).

C++ documentation:

This convenience function is equivalent to calling QPixmap::scroll(dx, dy, QRect(x, y, width, height), exposed).

This function was introduced in Qt 4.6.

See also QWidget::scroll() and QGraphicsItem::scroll().

pub unsafe fn scroll_3a(
    &mut self,
    dx: c_int,
    dy: c_int,
    rect: impl CastInto<Ref<QRect>>
)
[src]

Scrolls the area rect of this pixmap by (dx, dy). The exposed region is left unchanged. You can optionally pass a pointer to an empty QRegion to get the region that is exposed by the scroll operation.

Calls C++ function: void QPixmap::scroll(int dx, int dy, const QRect& rect).

C++ documentation:

Scrolls the area rect of this pixmap by (dx, dy). The exposed region is left unchanged. You can optionally pass a pointer to an empty QRegion to get the region that is exposed by the scroll operation.


  QPixmap pixmap("background.png");
  QRegion exposed;
  pixmap.scroll(10, 10, pixmap.rect(), &exposed);

You cannot scroll while there is an active painter on the pixmap.

This function was introduced in Qt 4.6.

See also QWidget::scroll() and QGraphicsItem::scroll().

pub unsafe fn set_device_pixel_ratio(&mut self, scale_factor: c_double)[src]

Sets the device pixel ratio for the pixmap. This is the ratio between image pixels and device-independent pixels.

Calls C++ function: void QPixmap::setDevicePixelRatio(double scaleFactor).

C++ documentation:

Sets the device pixel ratio for the pixmap. This is the ratio between image pixels and device-independent pixels.

The default scaleFactor is 1.0. Setting it to something else has two effects:

QPainters that are opened on the pixmap will be scaled. For example, painting on a 200x200 image if with a ratio of 2.0 will result in effective (device-independent) painting bounds of 100x100.

Code paths in Qt that calculate layout geometry based on the pixmap size will take the ratio into account: QSize layoutSize = pixmap.size() / pixmap.devicePixelRatio() The net effect of this is that the pixmap is displayed as high-DPI pixmap rather than a large pixmap (see Drawing High Resolution Versions of Pixmaps and Images).

See also devicePixelRatio().

pub unsafe fn set_mask(&mut self, arg1: impl CastInto<Ref<QBitmap>>)[src]

Sets a mask bitmap.

Calls C++ function: void QPixmap::setMask(const QBitmap& arg1).

C++ documentation:

Sets a mask bitmap.

This function merges the mask with the pixmap's alpha channel. A pixel value of 1 on the mask means the pixmap's pixel is unchanged; a value of 0 means the pixel is transparent. The mask must have the same size as this pixmap.

Setting a null mask resets the mask, leaving the previously transparent pixels black. The effect of this function is undefined when the pixmap is being painted on.

Warning: This is potentially an expensive operation.

See also mask(), Pixmap Transformations, and QBitmap.

pub unsafe fn size(&self) -> CppBox<QSize>[src]

Returns the size of the pixmap.

Calls C++ function: QSize QPixmap::size() const.

C++ documentation:

Returns the size of the pixmap.

See also width(), height(), and Pixmap Information.

pub unsafe fn swap(&mut self, other: impl CastInto<MutRef<QPixmap>>)[src]

Swaps pixmap other with this pixmap. This operation is very fast and never fails.

Calls C++ function: void QPixmap::swap(QPixmap& other).

C++ documentation:

Swaps pixmap other with this pixmap. This operation is very fast and never fails.

This function was introduced in Qt 4.8.

pub unsafe fn to_image(&self) -> CppBox<QImage>[src]

Converts the pixmap to a QImage. Returns a null image if the conversion fails.

Calls C++ function: QImage QPixmap::toImage() const.

C++ documentation:

Converts the pixmap to a QImage. Returns a null image if the conversion fails.

If the pixmap has 1-bit depth, the returned image will also be 1 bit deep. Images with more bits will be returned in a format closely represents the underlying system. Usually this will be QImage::Format_ARGB32_Premultiplied for pixmaps with an alpha and QImage::Format_RGB32 or QImage::Format_RGB16 for pixmaps without alpha.

Note that for the moment, alpha masks on monochrome images are ignored.

See also fromImage() and Image Formats.

pub unsafe fn to_q_variant(&self) -> CppBox<QVariant>[src]

Returns the pixmap as a QVariant.

Calls C++ function: QVariant QPixmap::operator QVariant() const.

C++ documentation:

Returns the pixmap as a QVariant.

pub unsafe fn transformed_q_matrix_transformation_mode(
    &self,
    arg1: impl CastInto<Ref<QMatrix>>,
    mode: TransformationMode
) -> CppBox<QPixmap>
[src]

This is an overloaded function.

Calls C++ function: QPixmap QPixmap::transformed(const QMatrix& arg1, Qt::TransformationMode mode = …) const.

C++ documentation:

This is an overloaded function.

This convenience function loads the matrix into a QTransform and calls the overloaded function.

pub unsafe fn transformed_q_transform_transformation_mode(
    &self,
    arg1: impl CastInto<Ref<QTransform>>,
    mode: TransformationMode
) -> CppBox<QPixmap>
[src]

Returns a copy of the pixmap that is transformed using the given transformation transform and transformation mode. The original pixmap is not changed.

Calls C++ function: QPixmap QPixmap::transformed(const QTransform& arg1, Qt::TransformationMode mode = …) const.

C++ documentation:

Returns a copy of the pixmap that is transformed using the given transformation transform and transformation mode. The original pixmap is not changed.

The transformation transform is internally adjusted to compensate for unwanted translation; i.e. the pixmap produced is the smallest pixmap that contains all the transformed points of the original pixmap. Use the trueMatrix() function to retrieve the actual matrix used for transforming the pixmap.

This function is slow because it involves transformation to a QImage, non-trivial computations and a transformation back to a QPixmap.

See also trueMatrix() and Pixmap Transformations.

pub unsafe fn transformed_q_matrix(
    &self,
    arg1: impl CastInto<Ref<QMatrix>>
) -> CppBox<QPixmap>
[src]

This is an overloaded function.

Calls C++ function: QPixmap QPixmap::transformed(const QMatrix& arg1) const.

C++ documentation:

This is an overloaded function.

This convenience function loads the matrix into a QTransform and calls the overloaded function.

pub unsafe fn transformed_q_transform(
    &self,
    arg1: impl CastInto<Ref<QTransform>>
) -> CppBox<QPixmap>
[src]

Returns a copy of the pixmap that is transformed using the given transformation transform and transformation mode. The original pixmap is not changed.

Calls C++ function: QPixmap QPixmap::transformed(const QTransform& arg1) const.

C++ documentation:

Returns a copy of the pixmap that is transformed using the given transformation transform and transformation mode. The original pixmap is not changed.

The transformation transform is internally adjusted to compensate for unwanted translation; i.e. the pixmap produced is the smallest pixmap that contains all the transformed points of the original pixmap. Use the trueMatrix() function to retrieve the actual matrix used for transforming the pixmap.

This function is slow because it involves transformation to a QImage, non-trivial computations and a transformation back to a QPixmap.

See also trueMatrix() and Pixmap Transformations.

pub unsafe fn width(&self) -> c_int[src]

Returns the width of the pixmap.

Calls C++ function: int QPixmap::width() const.

C++ documentation:

Returns the width of the pixmap.

See also size() and Pixmap Information.

Trait Implementations

impl CppDeletable for QBitmap[src]

unsafe fn delete(&mut self)[src]

Destroys the bitmap.

Calls C++ function: virtual [destructor] void QBitmap::~QBitmap().

C++ documentation:

Destroys the bitmap.

impl Deref for QBitmap[src]

type Target = QPixmap

The resulting type after dereferencing.

fn deref(&self) -> &QPixmap[src]

Calls C++ function: QPixmap* static_cast<QPixmap*>(QBitmap* ptr).

impl DerefMut for QBitmap[src]

fn deref_mut(&mut self) -> &mut QPixmap[src]

Calls C++ function: QPixmap* static_cast<QPixmap*>(QBitmap* ptr).

impl DynamicCast<QBitmap> for QPixmap[src]

unsafe fn dynamic_cast(ptr: Ptr<QPixmap>) -> Ptr<QBitmap>[src]

Calls C++ function: QBitmap* dynamic_cast<QBitmap*>(QPixmap* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QPixmap>) -> MutPtr<QBitmap>[src]

Calls C++ function: QBitmap* dynamic_cast<QBitmap*>(QPixmap* ptr).

impl DynamicCast<QBitmap> for QPaintDevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QBitmap>[src]

Calls C++ function: QBitmap* dynamic_cast<QBitmap*>(QPaintDevice* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QPaintDevice>) -> MutPtr<QBitmap>[src]

Calls C++ function: QBitmap* dynamic_cast<QBitmap*>(QPaintDevice* ptr).

impl StaticDowncast<QBitmap> for QPixmap[src]

unsafe fn static_downcast(ptr: Ptr<QPixmap>) -> Ptr<QBitmap>[src]

Calls C++ function: QBitmap* static_cast<QBitmap*>(QPixmap* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QPixmap>) -> MutPtr<QBitmap>[src]

Calls C++ function: QBitmap* static_cast<QBitmap*>(QPixmap* ptr).

impl StaticDowncast<QBitmap> for QPaintDevice[src]

unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QBitmap>[src]

Calls C++ function: QBitmap* static_cast<QBitmap*>(QPaintDevice* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QPaintDevice>) -> MutPtr<QBitmap>[src]

Calls C++ function: QBitmap* static_cast<QBitmap*>(QPaintDevice* ptr).

impl StaticUpcast<QPaintDevice> for QBitmap[src]

unsafe fn static_upcast(ptr: Ptr<QBitmap>) -> Ptr<QPaintDevice>[src]

Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QBitmap* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QBitmap>) -> MutPtr<QPaintDevice>[src]

Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QBitmap* ptr).

impl StaticUpcast<QPixmap> for QBitmap[src]

unsafe fn static_upcast(ptr: Ptr<QBitmap>) -> Ptr<QPixmap>[src]

Calls C++ function: QPixmap* static_cast<QPixmap*>(QBitmap* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QBitmap>) -> MutPtr<QPixmap>[src]

Calls C++ function: QPixmap* static_cast<QPixmap*>(QBitmap* ptr).

Auto Trait Implementations

impl RefUnwindSafe for QBitmap

impl Send for QBitmap

impl Sync for QBitmap

impl Unpin for QBitmap

impl UnwindSafe for QBitmap

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.