IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QBitmap Class

The https:// class provides monochrome (1-bit depth) pixmaps.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QBitmap Class▲

  • Header: QBitmap

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Gui)

    target_link_libraries(mytarget PRIVATE Qt6::Gui)

  • qmake: QT += gui

  • Inherits: https://

  • Group: QBitmap is part of https://, shared

Detailed Description▲

The https:// class is a monochrome off-screen paint device used mainly for creating custom https:// and https:// objects, constructing https:// objects, and for setting masks for pixmaps and widgets.

https:// is a https:// 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 https:// objects https:// and https:// when drawing on a https:// object (or a https:// object with depth 1).

Painting with https:// sets the bitmap bits to 0, and painting with https:// 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 https://() function to set all the bits to https://. Note that using the https:// and https:// colors make no sense because the QColor::pixel() value is not necessarily 0 for black and 1 for white.

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

Just like the https:// class, https:// is optimized by the use of implicit data sharing. For more information, see the https:// documentation.

See Also▲

See also https://, https://, https://, https://

Member Function Documentation▲

 

QBitmap::QBitmap()▲

Constructs a null bitmap.

See Also▲

See also https://()

QBitmap::QBitmap(int width, int height)▲

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

See Also▲

See also https://()

[explicit] QBitmap::QBitmap(const QString &fileName, const char *format = nullptr)▲

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 https://() function. If the file format uses more than 1 bit per pixel, the resulting bitmap will be dithered automatically.

See Also▲

See also https://(), https://()

void QBitmap::clear()▲

Clears the bitmap, setting all its bits to https://.

[static] QBitmap QBitmap::fromData(const QSize &size, const uchar *bits, QImage::Format monoFormat = QImage::Format_MonoLSB)▲

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 the bit order specified by monoFormat. The mono format must be either https:// or https://. Use https:// to specify data on the XBM format.

See Also▲

See also https://()

[static] QBitmap QBitmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor)▲

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

See Also▲

See also https://()

[static] QBitmap QBitmap::fromImage(QImage &&image, Qt::ImageConversionFlags flags = Qt::AutoColor)▲

This is an overloaded function.

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

See Also▲

See also https://()

[static, since 6.0] QBitmap QBitmap::fromPixmap(const QPixmap &pixmap)▲

Returns a copy of the given pixmap converted to a bitmap.

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

This function was introduced in Qt 6.0.

See Also▲

See also https://()

void QBitmap::swap(QBitmap &other)▲

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

QBitmap QBitmap::transformed(const QTransform &matrix) const▲

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

See Also▲

See also QPixmap::transformed()

QVariant QBitmap::operator QVariant() const▲

Returns the bitmap as a https://.

Obsolete Members for QBitmap▲

The following members of class https:// are deprecated. We strongly advise against using them in new code.

Obsolete Member Function Documentation▲

 
[explicit] QBitmap::QBitmap(const QPixmap &pixmap)▲

This function is deprecated since 6.0. We strongly advise against using it in new code.

Use https:// instead. 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▲

See also https://(), https://(), https://()

[explicit] QBitmap::QBitmap(const QSize &size)▲

This function is deprecated since 6.0. We strongly advise against using it in new code.

Use https:// instead.

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

See Also▲

See also https://()

QBitmap &QBitmap::operator=(const QPixmap &pixmap)▲

This function is deprecated since 6.0. We strongly advise against using it in new code.

Use https:// instead.

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▲

See also https://()

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+   

Ce document est disponible sous la licence https:// telle que publiée par la Free Software Foundation.