qt - Canvas image not grabbed in QQuickWindow -
i need capture image qml has canvas elements. whereas canvases displayed fine not correctly saved in picture snapshots.
i have used qquickwindow grabwindow method described in solutions of this link , images saved in ui thread called afterrendering signal (i have tried frameswapped signal too). result qml objects saved not canvas objects.
both renderstrategy , rendertargetof canvases set default values. simple canvases shown below:
canvas { id:canvas onpaint:{ var ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(20, 0); ctx.beziercurveto(-10, 90, 210, 90, 180, 0); ctx.stroke(); //... } } i have noticed afterrendering signal called multiple times.
any suggestion appreciated! :)
Comments
Post a Comment