qt - Canvas image not grabbed in QQuickWindow -
i need capture image qml has canvas
elements. whereas canvas
es 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
, rendertarget
of canvas
es set default values. simple canvas
es 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