Struct qt_gui::QPixmap

source ·
#[repr(C)]
pub struct QPixmap { /* private fields */ }
Expand description

The QPixmap class is an off-screen image representation that can be used as a paint device.

C++ class: QPixmap.

C++ documentation:

The QPixmap class is an off-screen image representation that can be used as a paint device.

Qt provides four classes for handling image data: QImage, QPixmap, QBitmap and QPicture. QImage is designed and optimized for I/O, and for direct pixel access and manipulation, while QPixmap is designed and optimized for showing images on screen. QBitmap is only a convenience class that inherits QPixmap, ensuring a depth of 1. The isQBitmap() function returns true if a QPixmap object is really a bitmap, otherwise returns false. Finally, the QPicture class is a paint device that records and replays QPainter commands.

A QPixmap can easily be displayed on the screen using QLabel or one of QAbstractButton's subclasses (such as QPushButton and QToolButton). QLabel has a pixmap property, whereas QAbstractButton has an icon property.

QPixmap objects can be passed around by value since the QPixmap class uses implicit data sharing. For more information, see the Implicit Data Sharing documentation. QPixmap objects can also be streamed.

Note that the pixel data in a pixmap is internal and is managed by the underlying window system. Because QPixmap is a QPaintDevice subclass, QPainter can be used to draw directly onto pixmaps. Pixels can only be accessed through QPainter functions or by converting the QPixmap to a QImage. However, the fill() function is available for initializing the entire pixmap with a given color.

There are functions to convert between QImage and QPixmap. Typically, the QImage class is used to load an image file, optionally manipulating the image data, before the QImage object is converted into a QPixmap to be shown on screen. Alternatively, if no manipulation is desired, the image file can be loaded directly into a QPixmap.

QPixmap provides a collection of functions that can be used to obtain a variety of information about the pixmap. In addition, there are several functions that enables transformation of the pixmap.

Implementations§

source§

impl QPixmap

source

pub unsafe fn cache_key(&self) -> i64

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.

source

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

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().

source

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

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().

source

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

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).

source

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

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.

source

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

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.

source

pub unsafe fn copy_from( &self, arg1: impl CastInto<Ref<QPixmap>> ) -> Ref<QPixmap>

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().

source

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

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().

source

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

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().

source

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

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().

source

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

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().

source

pub unsafe fn default_depth() -> c_int

Returns the default pixmap depth used by the application.

Calls C++ function: static int QPixmap::defaultDepth().

C++ documentation:

Returns the default pixmap depth used by the application.

On all platforms the depth of the primary screen will be returned.

Note: QGuiApplication must be created before calling this function.

See also depth(), QColormap::depth(), and Pixmap Information.

source

pub unsafe fn depth(&self) -> c_int

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.

source

pub unsafe fn detach(&self)

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.

source

pub unsafe fn dev_type(&self) -> c_int

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

source

pub unsafe fn device_pixel_ratio(&self) -> c_double

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.

source

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

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.

source

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

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.

source

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

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.

source

pub unsafe fn fill_0a(&self)

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.

source

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

Converts the given image to a pixmap 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.

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

C++ documentation:

Converts the given image to a pixmap 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.

In case of monochrome and 8-bit images, the image is first converted to a 32-bit pixmap and then filled with the colors in the color table. If this is too expensive an operation, you can use QBitmap::fromImage() instead.

See also fromImageReader(), toImage(), and Pixmap Conversion.

source

pub unsafe fn from_image_1a( image: impl CastInto<Ref<QImage>> ) -> CppBox<QPixmap>

Converts the given image to a pixmap 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.

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

C++ documentation:

Converts the given image to a pixmap 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.

In case of monochrome and 8-bit images, the image is first converted to a 32-bit pixmap and then filled with the colors in the color table. If this is too expensive an operation, you can use QBitmap::fromImage() instead.

See also fromImageReader(), toImage(), and Pixmap Conversion.

source

pub unsafe fn from_image_reader_2a( image_reader: impl CastInto<Ptr<QImageReader>>, flags: QFlags<ImageConversionFlag> ) -> CppBox<QPixmap>

Create a QPixmap from an image read directly from an imageReader. The flags argument is a bitwise-OR of the Qt::ImageConversionFlags. Passing 0 for flags sets all the default options.

Calls C++ function: static QPixmap QPixmap::fromImageReader(QImageReader* imageReader, QFlags<Qt::ImageConversionFlag> flags = …).

C++ documentation:

Create a QPixmap from an image read directly from an imageReader. The flags argument is a bitwise-OR of the Qt::ImageConversionFlags. Passing 0 for flags sets all the default options.

On some systems, reading an image directly to QPixmap can use less memory than reading a QImage to convert it to QPixmap.

See also fromImage(), toImage(), and Pixmap Conversion.

source

pub unsafe fn from_image_reader_1a( image_reader: impl CastInto<Ptr<QImageReader>> ) -> CppBox<QPixmap>

Create a QPixmap from an image read directly from an imageReader. The flags argument is a bitwise-OR of the Qt::ImageConversionFlags. Passing 0 for flags sets all the default options.

Calls C++ function: static QPixmap QPixmap::fromImageReader(QImageReader* imageReader).

C++ documentation:

Create a QPixmap from an image read directly from an imageReader. The flags argument is a bitwise-OR of the Qt::ImageConversionFlags. Passing 0 for flags sets all the default options.

On some systems, reading an image directly to QPixmap can use less memory than reading a QImage to convert it to QPixmap.

See also fromImage(), toImage(), and Pixmap Conversion.

source

pub unsafe fn grab_widget_q_object_q_rect( widget: impl CastInto<Ptr<QObject>>, rect: impl CastInto<Ref<QRect>> ) -> CppBox<QPixmap>

Use QWidget::grab() instead.

Calls C++ function: static QPixmap QPixmap::grabWidget(QObject* widget, const QRect& rect).

C++ documentation:

Use QWidget::grab() instead.

source

pub unsafe fn grab_widget_q_object4_int( widget: impl CastInto<Ptr<QObject>>, x: c_int, y: c_int, w: c_int, h: c_int ) -> CppBox<QPixmap>

Use QWidget::grab() instead.

Calls C++ function: static QPixmap QPixmap::grabWidget(QObject* widget, int x = …, int y = …, int w = …, int h = …).

C++ documentation:

Use QWidget::grab() instead.

source

pub unsafe fn grab_widget_q_object3_int( widget: impl CastInto<Ptr<QObject>>, x: c_int, y: c_int, w: c_int ) -> CppBox<QPixmap>

Use QWidget::grab() instead.

Calls C++ function: static QPixmap QPixmap::grabWidget(QObject* widget, int x = …, int y = …, int w = …).

C++ documentation:

Use QWidget::grab() instead.

source

pub unsafe fn grab_widget_q_object2_int( widget: impl CastInto<Ptr<QObject>>, x: c_int, y: c_int ) -> CppBox<QPixmap>

Use QWidget::grab() instead.

Calls C++ function: static QPixmap QPixmap::grabWidget(QObject* widget, int x = …, int y = …).

C++ documentation:

Use QWidget::grab() instead.

source

pub unsafe fn grab_widget_q_object_int( widget: impl CastInto<Ptr<QObject>>, x: c_int ) -> CppBox<QPixmap>

Use QWidget::grab() instead.

Calls C++ function: static QPixmap QPixmap::grabWidget(QObject* widget, int x = …).

C++ documentation:

Use QWidget::grab() instead.

source

pub unsafe fn grab_widget_q_object( widget: impl CastInto<Ptr<QObject>> ) -> CppBox<QPixmap>

Use QWidget::grab() instead.

Calls C++ function: static QPixmap QPixmap::grabWidget(QObject* widget).

C++ documentation:

Use QWidget::grab() instead.

source

pub unsafe fn grab_window_5a( arg1: c_ulonglong, x: c_int, y: c_int, w: c_int, h: c_int ) -> CppBox<QPixmap>

Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by QRect(x, y, width, height).

Calls C++ function: static QPixmap QPixmap::grabWindow(unsigned long long arg1, int x = …, int y = …, int w = …, int h = …).

C++ documentation:

Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by QRect(x, y, width, height).

The arguments (x, y) specify the offset in the window, whereas (width, height) specify the area to be copied. If width is negative, the function copies everything to the right border of the window. If height is negative, the function copies everything to the bottom of the window.

The window system identifier (WId) can be retrieved using the QWidget::winId() function. The rationale for using a window identifier and not a QWidget, is to enable grabbing of windows that are not part of the application, window system frames, and so on.

The grabWindow() function grabs pixels from the screen, not from the window, i.e. if there is another window partially or entirely over the one you grab, you get pixels from the overlying window, too. The mouse cursor is generally not grabbed.

Note on X11 that if the given window doesn't have the same depth as the root window, and another window partially or entirely obscures the one you grab, you will not get pixels from the overlying window. The contents of the obscured areas in the pixmap will be undefined and uninitialized.

On Windows Vista and above grabbing a layered window, which is created by setting the Qt::WA_TranslucentBackground attribute, will not work. Instead grabbing the desktop widget should work.

Warning: In general, grabbing an area outside the screen is not safe. This depends on the underlying window system.

Warning: The function is deprecated in Qt 5.0 since there might be platform plugins in which window system identifiers (WId) are local to a screen. Use QScreen::grabWindow() instead.

See also grabWidget(), Screenshot Example, and QScreen.

source

pub unsafe fn grab_window_4a( arg1: c_ulonglong, x: c_int, y: c_int, w: c_int ) -> CppBox<QPixmap>

Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by QRect(x, y, width, height).

Calls C++ function: static QPixmap QPixmap::grabWindow(unsigned long long arg1, int x = …, int y = …, int w = …).

C++ documentation:

Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by QRect(x, y, width, height).

The arguments (x, y) specify the offset in the window, whereas (width, height) specify the area to be copied. If width is negative, the function copies everything to the right border of the window. If height is negative, the function copies everything to the bottom of the window.

The window system identifier (WId) can be retrieved using the QWidget::winId() function. The rationale for using a window identifier and not a QWidget, is to enable grabbing of windows that are not part of the application, window system frames, and so on.

The grabWindow() function grabs pixels from the screen, not from the window, i.e. if there is another window partially or entirely over the one you grab, you get pixels from the overlying window, too. The mouse cursor is generally not grabbed.

Note on X11 that if the given window doesn't have the same depth as the root window, and another window partially or entirely obscures the one you grab, you will not get pixels from the overlying window. The contents of the obscured areas in the pixmap will be undefined and uninitialized.

On Windows Vista and above grabbing a layered window, which is created by setting the Qt::WA_TranslucentBackground attribute, will not work. Instead grabbing the desktop widget should work.

Warning: In general, grabbing an area outside the screen is not safe. This depends on the underlying window system.

Warning: The function is deprecated in Qt 5.0 since there might be platform plugins in which window system identifiers (WId) are local to a screen. Use QScreen::grabWindow() instead.

See also grabWidget(), Screenshot Example, and QScreen.

source

pub unsafe fn grab_window_3a( arg1: c_ulonglong, x: c_int, y: c_int ) -> CppBox<QPixmap>

Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by QRect(x, y, width, height).

Calls C++ function: static QPixmap QPixmap::grabWindow(unsigned long long arg1, int x = …, int y = …).

C++ documentation:

Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by QRect(x, y, width, height).

The arguments (x, y) specify the offset in the window, whereas (width, height) specify the area to be copied. If width is negative, the function copies everything to the right border of the window. If height is negative, the function copies everything to the bottom of the window.

The window system identifier (WId) can be retrieved using the QWidget::winId() function. The rationale for using a window identifier and not a QWidget, is to enable grabbing of windows that are not part of the application, window system frames, and so on.

The grabWindow() function grabs pixels from the screen, not from the window, i.e. if there is another window partially or entirely over the one you grab, you get pixels from the overlying window, too. The mouse cursor is generally not grabbed.

Note on X11 that if the given window doesn't have the same depth as the root window, and another window partially or entirely obscures the one you grab, you will not get pixels from the overlying window. The contents of the obscured areas in the pixmap will be undefined and uninitialized.

On Windows Vista and above grabbing a layered window, which is created by setting the Qt::WA_TranslucentBackground attribute, will not work. Instead grabbing the desktop widget should work.

Warning: In general, grabbing an area outside the screen is not safe. This depends on the underlying window system.

Warning: The function is deprecated in Qt 5.0 since there might be platform plugins in which window system identifiers (WId) are local to a screen. Use QScreen::grabWindow() instead.

See also grabWidget(), Screenshot Example, and QScreen.

source

pub unsafe fn grab_window_2a(arg1: c_ulonglong, x: c_int) -> CppBox<QPixmap>

Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by QRect(x, y, width, height).

Calls C++ function: static QPixmap QPixmap::grabWindow(unsigned long long arg1, int x = …).

C++ documentation:

Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by QRect(x, y, width, height).

The arguments (x, y) specify the offset in the window, whereas (width, height) specify the area to be copied. If width is negative, the function copies everything to the right border of the window. If height is negative, the function copies everything to the bottom of the window.

The window system identifier (WId) can be retrieved using the QWidget::winId() function. The rationale for using a window identifier and not a QWidget, is to enable grabbing of windows that are not part of the application, window system frames, and so on.

The grabWindow() function grabs pixels from the screen, not from the window, i.e. if there is another window partially or entirely over the one you grab, you get pixels from the overlying window, too. The mouse cursor is generally not grabbed.

Note on X11 that if the given window doesn't have the same depth as the root window, and another window partially or entirely obscures the one you grab, you will not get pixels from the overlying window. The contents of the obscured areas in the pixmap will be undefined and uninitialized.

On Windows Vista and above grabbing a layered window, which is created by setting the Qt::WA_TranslucentBackground attribute, will not work. Instead grabbing the desktop widget should work.

Warning: In general, grabbing an area outside the screen is not safe. This depends on the underlying window system.

Warning: The function is deprecated in Qt 5.0 since there might be platform plugins in which window system identifiers (WId) are local to a screen. Use QScreen::grabWindow() instead.

See also grabWidget(), Screenshot Example, and QScreen.

source

pub unsafe fn grab_window_1a(arg1: c_ulonglong) -> CppBox<QPixmap>

Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by QRect(x, y, width, height).

Calls C++ function: static QPixmap QPixmap::grabWindow(unsigned long long arg1).

C++ documentation:

Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by QRect(x, y, width, height).

The arguments (x, y) specify the offset in the window, whereas (width, height) specify the area to be copied. If width is negative, the function copies everything to the right border of the window. If height is negative, the function copies everything to the bottom of the window.

The window system identifier (WId) can be retrieved using the QWidget::winId() function. The rationale for using a window identifier and not a QWidget, is to enable grabbing of windows that are not part of the application, window system frames, and so on.

The grabWindow() function grabs pixels from the screen, not from the window, i.e. if there is another window partially or entirely over the one you grab, you get pixels from the overlying window, too. The mouse cursor is generally not grabbed.

Note on X11 that if the given window doesn't have the same depth as the root window, and another window partially or entirely obscures the one you grab, you will not get pixels from the overlying window. The contents of the obscured areas in the pixmap will be undefined and uninitialized.

On Windows Vista and above grabbing a layered window, which is created by setting the Qt::WA_TranslucentBackground attribute, will not work. Instead grabbing the desktop widget should work.

Warning: In general, grabbing an area outside the screen is not safe. This depends on the underlying window system.

Warning: The function is deprecated in Qt 5.0 since there might be platform plugins in which window system identifiers (WId) are local to a screen. Use QScreen::grabWindow() instead.

See also grabWidget(), Screenshot Example, and QScreen.

source

pub unsafe fn has_alpha(&self) -> bool

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().

source

pub unsafe fn has_alpha_channel(&self) -> bool

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().

source

pub unsafe fn height(&self) -> c_int

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.

source

pub unsafe fn is_detached(&self) -> bool

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

source

pub unsafe fn is_null(&self) -> bool

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.

source

pub unsafe fn is_q_bitmap(&self) -> bool

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.

source

pub unsafe fn load_3a( &self, file_name: impl CastInto<Ref<QString>>, format: *const c_char, flags: QFlags<ImageConversionFlag> ) -> bool

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.

source

pub unsafe fn load_2a( &self, file_name: impl CastInto<Ref<QString>>, format: *const c_char ) -> bool

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.

source

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

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.

source

pub unsafe fn load_from_data_uchar_uint_char_q_flags_image_conversion_flag( &self, buf: *const c_uchar, len: c_uint, format: *const c_char, flags: QFlags<ImageConversionFlag> ) -> bool

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.

source

pub unsafe fn load_from_data_q_byte_array_char_q_flags_image_conversion_flag( &self, data: impl CastInto<Ref<QByteArray>>, format: *const c_char, flags: QFlags<ImageConversionFlag> ) -> bool

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.

source

pub unsafe fn load_from_data_uchar_uint_char( &self, buf: *const c_uchar, len: c_uint, format: *const c_char ) -> bool

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.

source

pub unsafe fn load_from_data_uchar_uint( &self, buf: *const c_uchar, len: c_uint ) -> bool

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.

source

pub unsafe fn load_from_data_q_byte_array_char( &self, data: impl CastInto<Ref<QByteArray>>, format: *const c_char ) -> bool

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.

source

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

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.

source

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

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.

source

pub unsafe fn new() -> CppBox<QPixmap>

Constructs a null pixmap.

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

C++ documentation:

Constructs a null pixmap.

See also isNull().

source

pub unsafe fn from_2_int(w: c_int, h: c_int) -> CppBox<QPixmap>

Constructs a pixmap with the given width and height. If either width or height is zero, a null pixmap is constructed.

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

C++ documentation:

Constructs a pixmap with the given width and height. If either width or height is zero, a null pixmap is constructed.

Warning: This will create a QPixmap with uninitialized data. Call fill() to fill the pixmap with an appropriate color before drawing onto it with QPainter.

See also isNull().

source

pub unsafe fn from_q_size(arg1: impl CastInto<Ref<QSize>>) -> CppBox<QPixmap>

This is an overloaded function.

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

C++ documentation:

This is an overloaded function.

Constructs a pixmap of the given size.

Warning: This will create a QPixmap with uninitialized data. Call fill() to fill the pixmap with an appropriate color before drawing onto it with QPainter.

source

pub unsafe fn from_q_string_char_q_flags_image_conversion_flag( file_name: impl CastInto<Ref<QString>>, format: *const c_char, flags: QFlags<ImageConversionFlag> ) -> CppBox<QPixmap>

Constructs a pixmap from the file with the given fileName. If the file does not exist or is of an unknown format, the pixmap becomes a null pixmap.

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

C++ documentation:

Constructs a pixmap from the file with the given fileName. If the file does not exist or is of an unknown format, the pixmap becomes a null pixmap.

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 images and other resource files in the application's executable.

If the image 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.

The fileName, format and flags parameters are passed on to load(). This means that the data in fileName is not compiled into the binary. If fileName contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory.

See also Reading and Writing Image Files.

source

pub unsafe fn from_q_string_char( file_name: impl CastInto<Ref<QString>>, format: *const c_char ) -> CppBox<QPixmap>

Constructs a pixmap from the file with the given fileName. If the file does not exist or is of an unknown format, the pixmap becomes a null pixmap.

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

C++ documentation:

Constructs a pixmap from the file with the given fileName. If the file does not exist or is of an unknown format, the pixmap becomes a null pixmap.

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 images and other resource files in the application's executable.

If the image 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.

The fileName, format and flags parameters are passed on to load(). This means that the data in fileName is not compiled into the binary. If fileName contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory.

See also Reading and Writing Image Files.

source

pub unsafe fn from_q_string( file_name: impl CastInto<Ref<QString>> ) -> CppBox<QPixmap>

Constructs a pixmap from the file with the given fileName. If the file does not exist or is of an unknown format, the pixmap becomes a null pixmap.

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

C++ documentation:

Constructs a pixmap from the file with the given fileName. If the file does not exist or is of an unknown format, the pixmap becomes a null pixmap.

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 images and other resource files in the application's executable.

If the image 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.

The fileName, format and flags parameters are passed on to load(). This means that the data in fileName is not compiled into the binary. If fileName contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory.

See also Reading and Writing Image Files.

source

pub unsafe fn new_copy(arg1: impl CastInto<Ref<QPixmap>>) -> CppBox<QPixmap>

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

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

C++ documentation:

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

See also copy().

source

pub unsafe fn paint_engine(&self) -> Ptr<QPaintEngine>

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

source

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

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.

source

pub unsafe fn save_q_string_char_int( &self, file_name: impl CastInto<Ref<QString>>, format: *const c_char, quality: c_int ) -> bool

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.

source

pub unsafe fn save_q_io_device_char_int( &self, device: impl CastInto<Ptr<QIODevice>>, format: *const c_char, quality: c_int ) -> bool

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

source

pub unsafe fn save_q_string_char( &self, file_name: impl CastInto<Ref<QString>>, format: *const c_char ) -> bool

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.

source

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

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.

source

pub unsafe fn save_q_io_device_char( &self, device: impl CastInto<Ptr<QIODevice>>, format: *const c_char ) -> bool

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

source

pub unsafe fn save_q_io_device( &self, device: impl CastInto<Ptr<QIODevice>> ) -> bool

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

source

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>

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.

source

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

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.

source

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

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.

source

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

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.

source

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

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.

source

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

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.

source

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

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.

source

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

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.

source

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

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.

source

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

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.

source

pub unsafe fn scroll_7a( &self, dx: c_int, dy: c_int, x: c_int, y: c_int, width: c_int, height: c_int, exposed: impl CastInto<Ptr<QRegion>> )

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().

source

pub unsafe fn scroll_4a( &self, dx: c_int, dy: c_int, rect: impl CastInto<Ref<QRect>>, exposed: impl CastInto<Ptr<QRegion>> )

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().

source

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

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().

source

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

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().

source

pub unsafe fn set_device_pixel_ratio(&self, scale_factor: c_double)

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().

source

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

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.

source

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

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.

source

pub unsafe fn swap(&self, other: impl CastInto<Ref<QPixmap>>)

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.

source

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

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.

source

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

Returns the pixmap as a QVariant.

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

C++ documentation:

Returns the pixmap as a QVariant.

source

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

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.

source

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

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.

source

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

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.

source

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

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.

source

pub unsafe fn true_matrix_q_matrix2_int( m: impl CastInto<Ref<QMatrix>>, w: c_int, h: c_int ) -> CppBox<QMatrix>

This is an overloaded function.

Calls C++ function: static QMatrix QPixmap::trueMatrix(const QMatrix& m, int w, int h).

C++ documentation:

This is an overloaded function.

This convenience function loads the matrix m into a QTransform and calls the overloaded function with the QTransform and the width w and the height h.

source

pub unsafe fn true_matrix_q_transform2_int( m: impl CastInto<Ref<QTransform>>, w: c_int, h: c_int ) -> CppBox<QTransform>

Returns the actual matrix used for transforming a pixmap with the given width, height and matrix.

Calls C++ function: static QTransform QPixmap::trueMatrix(const QTransform& m, int w, int h).

C++ documentation:

Returns the actual matrix used for transforming a pixmap with the given width, height and matrix.

When transforming a pixmap using the transformed() function, the transformation matrix is internally adjusted to compensate for unwanted translation, i.e. transformed() returns the smallest pixmap containing all transformed points of the original pixmap. This function returns the modified matrix, which maps points correctly from the original pixmap into the new pixmap.

See also transformed() and Pixmap Transformations.

source

pub unsafe fn width(&self) -> c_int

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.

Methods from Deref<Target = QPaintDevice>§

source

pub unsafe fn color_count(&self) -> c_int

Returns the number of different colors available for the paint device. If the number of colors available is too great to be represented by the int data type, then INT_MAX will be returned instead.

Calls C++ function: int QPaintDevice::colorCount() const.

C++ documentation:

Returns the number of different colors available for the paint device. If the number of colors available is too great to be represented by the int data type, then INT_MAX will be returned instead.

source

pub unsafe fn depth(&self) -> c_int

Returns the bit depth (number of bit planes) of the paint device.

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

C++ documentation:

Returns the bit depth (number of bit planes) of the paint device.

source

pub unsafe fn dev_type(&self) -> c_int

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

source

pub unsafe fn device_pixel_ratio(&self) -> c_int

Returns the device pixel ratio for device.

Calls C++ function: int QPaintDevice::devicePixelRatio() const.

C++ documentation:

Returns the device pixel ratio for device.

Common values are 1 for normal-dpi displays and 2 for high-dpi "retina" displays.

source

pub unsafe fn device_pixel_ratio_f(&self) -> c_double

Returns the device pixel ratio for the device as a floating point number.

Calls C++ function: double QPaintDevice::devicePixelRatioF() const.

C++ documentation:

Returns the device pixel ratio for the device as a floating point number.

This function was introduced in Qt 5.6.

source

pub unsafe fn height(&self) -> c_int

Returns the height of the paint device in default coordinate system units (e.g. pixels for QPixmap and QWidget).

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

C++ documentation:

Returns the height of the paint device in default coordinate system units (e.g. pixels for QPixmap and QWidget).

See also heightMM().

source

pub unsafe fn height_m_m(&self) -> c_int

Returns the height of the paint device in millimeters. Due to platform limitations it may not be possible to use this function to determine the actual physical size of a widget on the screen.

Calls C++ function: int QPaintDevice::heightMM() const.

C++ documentation:

Returns the height of the paint device in millimeters. Due to platform limitations it may not be possible to use this function to determine the actual physical size of a widget on the screen.

See also height().

source

pub unsafe fn logical_dpi_x(&self) -> c_int

Returns the horizontal resolution of the device in dots per inch, which is used when computing font sizes. For X11, this is usually the same as could be computed from widthMM().

Calls C++ function: int QPaintDevice::logicalDpiX() const.

C++ documentation:

Returns the horizontal resolution of the device in dots per inch, which is used when computing font sizes. For X11, this is usually the same as could be computed from widthMM().

Note that if the logicalDpiX() doesn't equal the physicalDpiX(), the corresponding QPaintEngine must handle the resolution mapping.

See also logicalDpiY() and physicalDpiX().

source

pub unsafe fn logical_dpi_y(&self) -> c_int

Returns the vertical resolution of the device in dots per inch, which is used when computing font sizes. For X11, this is usually the same as could be computed from heightMM().

Calls C++ function: int QPaintDevice::logicalDpiY() const.

C++ documentation:

Returns the vertical resolution of the device in dots per inch, which is used when computing font sizes. For X11, this is usually the same as could be computed from heightMM().

Note that if the logicalDpiY() doesn't equal the physicalDpiY(), the corresponding QPaintEngine must handle the resolution mapping.

See also logicalDpiX() and physicalDpiY().

source

pub unsafe fn paint_engine(&self) -> Ptr<QPaintEngine>

Returns a pointer to the paint engine used for drawing on the device.

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

C++ documentation:

Returns a pointer to the paint engine used for drawing on the device.

source

pub unsafe fn painting_active(&self) -> bool

Returns true if the device is currently being painted on, i.e. someone has called QPainter::begin() but not yet called QPainter::end() for this device; otherwise returns false.

Calls C++ function: bool QPaintDevice::paintingActive() const.

C++ documentation:

Returns true if the device is currently being painted on, i.e. someone has called QPainter::begin() but not yet called QPainter::end() for this device; otherwise returns false.

See also QPainter::isActive().

source

pub unsafe fn physical_dpi_x(&self) -> c_int

Returns the horizontal resolution of the device in dots per inch. For example, when printing, this resolution refers to the physical printer's resolution. The logical DPI on the other hand, refers to the resolution used by the actual paint engine.

Calls C++ function: int QPaintDevice::physicalDpiX() const.

C++ documentation:

Returns the horizontal resolution of the device in dots per inch. For example, when printing, this resolution refers to the physical printer’s resolution. The logical DPI on the other hand, refers to the resolution used by the actual paint engine.

Note that if the physicalDpiX() doesn't equal the logicalDpiX(), the corresponding QPaintEngine must handle the resolution mapping.

See also physicalDpiY() and logicalDpiX().

source

pub unsafe fn physical_dpi_y(&self) -> c_int

Returns the horizontal resolution of the device in dots per inch. For example, when printing, this resolution refers to the physical printer's resolution. The logical DPI on the other hand, refers to the resolution used by the actual paint engine.

Calls C++ function: int QPaintDevice::physicalDpiY() const.

C++ documentation:

Returns the horizontal resolution of the device in dots per inch. For example, when printing, this resolution refers to the physical printer’s resolution. The logical DPI on the other hand, refers to the resolution used by the actual paint engine.

Note that if the physicalDpiY() doesn't equal the logicalDpiY(), the corresponding QPaintEngine must handle the resolution mapping.

See also physicalDpiX() and logicalDpiY().

source

pub unsafe fn width(&self) -> c_int

Returns the width of the paint device in default coordinate system units (e.g. pixels for QPixmap and QWidget).

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

C++ documentation:

Returns the width of the paint device in default coordinate system units (e.g. pixels for QPixmap and QWidget).

See also widthMM().

source

pub unsafe fn width_m_m(&self) -> c_int

Returns the width of the paint device in millimeters. Due to platform limitations it may not be possible to use this function to determine the actual physical size of a widget on the screen.

Calls C++ function: int QPaintDevice::widthMM() const.

C++ documentation:

Returns the width of the paint device in millimeters. Due to platform limitations it may not be possible to use this function to determine the actual physical size of a widget on the screen.

See also width().

Trait Implementations§

source§

impl CppDeletable for QPixmap

source§

unsafe fn delete(&self)

Destroys the pixmap.

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

C++ documentation:

Destroys the pixmap.

source§

impl Deref for QPixmap

source§

fn deref(&self) -> &QPaintDevice

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

§

type Target = QPaintDevice

The resulting type after dereferencing.
source§

impl DynamicCast<QBitmap> for QPixmap

source§

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

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

source§

impl DynamicCast<QPixmap> for QPaintDevice

source§

unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QPixmap>

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

source§

impl Not for &QPixmap

source§

fn not(self) -> bool

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

Calls C++ function: bool QPixmap::operator!() const.

C++ documentation:

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

See also isNull().

§

type Output = bool

The resulting type after applying the ! operator.
source§

impl Size for QPixmap

source§

unsafe fn size(&self) -> usize

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.

source§

impl StaticDowncast<QBitmap> for QPixmap

source§

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

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

source§

impl StaticDowncast<QPixmap> for QPaintDevice

source§

unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QPixmap>

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

source§

impl StaticUpcast<QPaintDevice> for QPixmap

source§

unsafe fn static_upcast(ptr: Ptr<QPixmap>) -> Ptr<QPaintDevice>

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

source§

impl StaticUpcast<QPixmap> for QBitmap

source§

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

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

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.