Created
December 31, 2017 07:38
-
-
Save HamedMasafi/54854a6b2e15130825d511b73a1a774d to your computer and use it in GitHub Desktop.
Shape in canvas sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
Item { | |
Canvas { | |
id: mycanvas | |
contextType: "2d" | |
anchors.fill: parent | |
Path{ | |
id: path | |
startX: 0 | |
startY: 0 | |
PathQuad{ | |
x:100 | |
y:100 | |
controlX: 50 | |
controlY: 70 | |
} | |
} | |
onPaint: { | |
context.reset(); | |
context.strokeStyle = Qt.rgba(.4,.6,.8); | |
context.path = path; | |
context.stroke(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment