Qt3DRender::QRenderCapture Class

class Qt3DRender::QRenderCapture

用于渲染捕捉的帧图节点。更多

Header: #include <Qt3DRender/QRenderCapture>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
在 QML 中: RenderCapture
继承: Qt3DRender::QFrameGraphNode
状态:已废弃

公共函数

QRenderCapture(Qt3DCore::QNode *parent = nullptr)
Qt3DRender::QRenderCaptureReply *requestCapture()
Qt3DRender::QRenderCaptureReply *requestCapture(const QRect &rect)

详细说明

QRenderCapture 用于在任何渲染阶段捕捉渲染到的图像。捕获必须由用户发起,每个捕获请求将返回一张图像。用户可同时发出多个渲染捕获请求,但每个 QRenderCapture 实例每帧只能处理一个请求。

成员函数文档

[explicit] QRenderCapture::QRenderCapture(Qt3DCore::QNode *parent = nullptr)

构造函数以指定的parent 创建一个实例。

[invokable] Qt3DRender::QRenderCaptureReply *QRenderCapture::requestCapture()

用于请求渲染捕捉。即使帧图有多个叶节点,每次 requestCapture 调用也只会产生一个渲染捕捉结果。函数会返回一个QRenderCaptureReply 对象,该对象会在捕获完成后接收捕获的图像。用户负责通过调用 deleterLater() 来取消分配返回的对象。

注: 可通过元对象系统和 QML 调用此函数。请参阅Q_INVOKABLE

[invokable] Qt3DRender::QRenderCaptureReply *QRenderCapture::requestCapture(const QRect &rect)

用于从指定的rect 请求渲染捕捉。即使帧图有多个叶节点,每次 requestCapture 调用也只会产生一个呈现捕捉结果。函数返回一个QRenderCaptureReply 对象,该对象在捕获完成后接收捕获的图像。用户负责通过调用deleteLater() 来取消分配返回的对象。

注: 可通过元对象系统和 QML 调用此函数。请参阅Q_INVOKABLE

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