html5 canvas - Qt (QML) Dashed Circle -
is there way draw half dashed circle in qml? drawn half circle in way
var circle = getcontext("2d"); circle.save(); var circlegradient = circle.createlineargradient(parent.width/4,parent.height,parent.width/4,0); circlegradient.addcolorstop(0, firstgradientpoint); circlegradient.addcolorstop(1, secondgradientpoint); circle.clearrect(0, 0, parent.width, parent.height); circle.beginpath(); circle.linecap = "round"; circle.linewidth = 10; circle.strokestyle = circlegradient circle.arc(parent.width/2, parent.height/2, canvas.radius - (circle.linewidth / 2), math.pi/2, canvas.value); circle.stroke(); circle.restore();
result
but how can make dashed this.
i need
i know qml little bit never coded. can solve problem logic.
here logic- code below pseudo, not work give idea.
draw small arcs in loop spaces in between.
//declare angles start , end startangle = 0.0; endangle = pi/20;// 10 arcs , 10 spaces while (q++ < 10){ circle.arc(parent.width/2, parent.height/2, canvas.radius - (circle.linewidth / 2), startangle, endangle, canvas.value) //leave space , create new start , end angle. startangle = endangle + endangle; endangle = startangle + endangle; }
Comments
Post a Comment