| qquickcanvascontext.cpp |
|
814 |
- |
| qquickcanvascontext_p.h |
|
1590 |
- |
| qquickcanvasitem.cpp |
|
39032 |
- |
| qquickcanvasitem_p.h |
|
5781 |
- |
| qquickcontext2d.cpp |
!
\qmltype Context2D
\nativetype QQuickContext2D
\inqmlmodule QtQuick
\ingroup qtquick-canvas
\since 5.0
\brief Provides 2D context for shapes on a Canvas item.
The Context2D object can be created by \c Canvas item's \c getContext()
method:
\code
Canvas {
id:canvas
onPaint:{
var ctx = canvas.getContext('2d');
//...
}
}
\endcode
The Context2D API implements the same \l
{http://www.w3.org/TR/2dcontext}{W3C Canvas 2D Context API standard} with
some enhanced features.
The Context2D API provides the rendering \b{context} which defines the
methods and attributes needed to draw on the \c Canvas item. The following
assigns the canvas rendering context to a \c{context} variable:
\code
var context = mycanvas.getContext("2d")
\endcode
The Context2D API renders the canvas as a coordinate system whose origin
(0,0) is at the top left corner, as shown in the figure below. Coordinates
increase along the \c{x} axis from left to right and along the \c{y} axis
from top to bottom of the canvas.
\image qml-item-canvas-context.gif {Canvas coordinate system with
origin at top-left, x-axis right, y-axis down, 300x150 default size}
|
174370 |
- |
| qquickcontext2d_p.h |
|
7490 |
- |
| qquickcontext2dcommandbuffer.cpp |
|
14734 |
- |
| qquickcontext2dcommandbuffer_p.h |
|
7087 |
- |
| qquickcontext2dtexture.cpp |
|
11384 |
- |
| qquickcontext2dtexture_p.h |
|
4920 |
- |
| qquickcontext2dtile.cpp |
|
2203 |
- |
| qquickcontext2dtile_p.h |
|
1531 |
- |