On this page

QCOffscreenCanvas Class

QCOffscreenCanvas represents an offscreen canvas that QCPainter can target. More...

Header: #include <QCOffscreenCanvas>

Detailed Description

An offscreen canvas is essentially a color buffer (a QRhiTexture), and possibly other associated graphics resources. After content has been rendered into the canvas's color buffer, the canvas can be registered to the painter to retrieve a QCImage that can then be used in drawImage() calls or as an image pattern.

To create an offscreen canvas, call QCPainter::createCanvas(). To target with with draw commands, call QRhiPaintDriver::beginPaint() when working with the lower level API, or QCPainterWidget::beginCanvasPainting() or QQuickCPainterRenderer::beginCanvasPainting() when using the QCPainter convenience widget and item implementations.

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.