Qpixmap grabwindow windows 7
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. 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. 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.
This convenience function is equivalent to calling QPixmap::scroll dx , dy , QRect x , y , width , height , exposed. 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. Sets the device pixel ratio for the pixmap. This is the ratio between image pixels and device-independent pixels. QPainters that are opened on the pixmap will be scaled.
For example, painting on a x image if with a ratio of 2. 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. See also mask , Pixmap Transformations , and QBitmap.
See also width , height , and Pixmap Information. 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. See also fromImage and Image Formats. 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.
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. 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.
This function returns the modified matrix, which maps points correctly from the original pixmap into the new pixmap. See also transformed and Pixmap Transformations.
Writes the given pixmap to the given stream as a PNG image. Note that writing the stream to a file will not produce a valid image file. Documentation contributions included herein are the copyrights of their respective owners.
Qt and respective logos are trademarks of The Qt Company Ltd. All other trademarks are property of their respective owners. QPixmap Class The QPixmap class is an off-screen image representation that can be used as a paint device. Reading and Writing Image Files QPixmap provides several ways of reading an image file: The file can be loaded when constructing the QPixmap object, or by using the load or loadFromData functions later on. Simply call the save function to save a QPixmap object.
Available Functions Geometry The size , width and height functions provide information about the pixmap's size. The rect function returns the image's enclosing rectangle. Alpha component The hasAlphaChannel returns true if the pixmap has a format that respects the alpha channel, otherwise returns false. The hasAlpha , setMask and mask functions are legacy and should not be used. They are potentially very slow.
Low-level information The depth function returns the depth of the pixmap. The defaultDepth function returns the default depth, i. See also copy. Errors are silently ignored. QPixmap myPixmap; myPixmap. The grabWindow function grabs pixels from the screen, not from the window, i.
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. 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. Use QScreen::grabWindow instead. Returns a number that identifies the contents of this QPixmap object.
QImage and PySide. Note that the pixel data in a pixmap is internal and is managed by the underlying window system. Because PySide. QPixmap is a PySide. QPaintDevice subclass, PySide. QPainter can be used to draw directly onto pixmaps. Pixels can only be accessed through PySide. QPainter functions or by converting the PySide. QPixmap to a PySide. However, the PySide. There are functions to convert between PySide. Typically, the PySide. QImage class is used to load an image file, optionally manipulating the image data, before the PySide.
QImage object is converted into a PySide. QPixmap to be shown on screen. Alternatively, if no manipulation is desired, the image file can be loaded directly into a PySide.
On Windows, the PySide. On Symbian, the PySide. 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.
QPixmap provides several ways of reading an image file: The file can be loaded when constructing the PySide. QPixmap object, or by using the PySide. Simply call the PySide. QPixmap object. The complete list of supported file formats are available through the QImageReader. New file formats can be added as plugins.
By default, Qt supports the following formats:. QPixmap provides a collection of functions that can be used to obtain a variety of information about the pixmap:. They are potentially very slow. Note that the two latter functions are only available on x QPixmap object can be converted into a PySide.
QImage using the PySide. Likewise, a PySide. QImage can be converted into a PySide. QPixmap using the PySide. If this is too expensive an operation, you can use QBitmap. In addition, on Windows, the PySide. QPixmap , based on the given QPixmap. QPixmap that is equivalent to the given bitmap which has the specified format.
QPixmap that is equivalent to the given icon. In addition, on Symbian, the PySide. QPixmap , based on given mode and returns a CFbsBitmap object. QPixmap that is equivalent to the given bitmap and given mode. QPixmap supports a number of functions for creating a new pixmap that is a transformed version of the original:.
QPixmap that is a plain copy of the original one. The static PySide. When using the native X11 graphics system, the pixmap becomes invalid when the PySide. QApplication instance is destroyed. QBitmap PySide. QImage PySide. QImageReader PySide. Constructs a pixmap that is a copy of the given pixmap. Constructs a pixmap of the given size.
This will create a PySide. QPixmap with uninitialized data. Call PySide. Constructs a pixmap with the given width and height. If either width or height is zero, a null pixmap is constructed. This enum type defines the share modes that are available when creating a PySide. QPixmap object from a raw X11 Pixmap handle.
Returns the alpha channel of the pixmap as a new grayscale PySide. You can use this function while debugging to get a visible image of the alpha channel. You can check this with the isNull function. This is an expensive operation. The alpha channel of the pixmap is extracted dynamically from the pixeldata. Most usecases of this function are covered by PySide. QPainter and compositionModes which will normally execute faster.
Returns a number that identifies this PySide. Distinct PySide. QPixmap objects can only have the same cache key if they refer to the same contents.
Returns a deep copy of the subset of the pixmap that is specified by the rectangle PySide. QRect x , y , width , height.
0コメント