How could I translate the QML scene(like Rectangle, Image etc) into a texture and save it? Anyone tried this before?If I can translate the components to texture, then I should be able to save the image after processing by particle systems or shaderEffects
Example:
Rectangle{
id:root
widht:640
height: 480
ToTexture{ id: toTexture} //a new type created by c++
MouseArea{
anchors.fill: parent
onClicked: {
toTexture.saveAsTexture(root)
}
}
}
The problem is, how could I design a new type like ToTexture? The example of " Scene Graph - OpenGL Under QML." show us how to render a qml scene, but I can't find an example show us how to transfer the qml scene to a texture.
Without this function, I can't save the graph generated QtQuick