Using the Canvas QML type
Canvas allows you to draw straight and curved lines, simple and complex shapes, graphs, and graphic images that have been referenced. Text, colors, shadows, gradients, and patterns can also be added, as well as low-level pixel operations. You can save a Canvas
output as an image. It provides a 2D canvas that uses a Context2D
object for drawing and implements a paint signal handler.
Let's have a look at the following example:
import QtQuick import QtQuick.Window Window { width: 512 height: 512 visible: true title: qsTr("Canvas Demo") Canvas { id: canvas anchors.fill: parent onPaint: { var context = getContext...