}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::restore()
+ \qmlmethod object QtQuick2::Context2D::restore()
Pops the top state on the stack, restoring the context to that state.
\sa QtQuick2::Context2D::save()
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::reset()
+ \qmlmethod object QtQuick2::Context2D::reset()
Resets the context state and properties to the default values.
*/
static v8::Handle<v8::Value> ctx2d_reset(const v8::Arguments &args)
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::save()
+ \qmlmethod object QtQuick2::Context2D::save()
Pushes the current state onto the state stack.
Before changing any state attributes, you should save the current state
// transformations
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::rotate(real angle)
+ \qmlmethod object QtQuick2::Context2D::rotate(real angle)
Rotate the canvas around the current origin by \c angle in radians and clockwise direction.
\code
ctx.rotate(Math.PI/2);
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::scale(real x, real y)
+ \qmlmethod object QtQuick2::Context2D::scale(real x, real y)
Increases or decreases the size of each unit in the canvas grid by multiplying the scale factors
to the current tranform matrix.
Where \c x is the scale factor in the horizontal direction and \c y is the scale factor in the
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::setTransform(real a, real b, real c, real d, real e, real f)
+ \qmlmethod object QtQuick2::Context2D::setTransform(real a, real b, real c, real d, real e, real f)
Changes the transformation matrix to the matrix given by the arguments as described below.
Modifying the transformation matrix directly enables you to perform scaling,
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::transform(real a, real b, real c, real d, real e, real f)
+ \qmlmethod object QtQuick2::Context2D::transform(real a, real b, real c, real d, real e, real f)
This method is very similar to \a QtQuick2::Context2D::setTransform(), but instead of replacing the old
tranform matrix, this method applies the given tranform matrix to the current matrix by mulitplying to it.
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::translate(real x, real y)
+ \qmlmethod object QtQuick2::Context2D::translate(real x, real y)
Translates the origin of the canvas to point (\c x, \c y).
\c x is the horizontal distance that the origin is translated, in coordinate space units,
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::resetTransform()
+ \qmlmethod object QtQuick2::Context2D::resetTransform()
Reset the transformation matrix to default value.
\sa QtQuick2::Context2D::transform(), QtQuick2::Context2D::setTransform(), QtQuick2::Context2D::reset()
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::shear(real sh, real sv )
+ \qmlmethod object QtQuick2::Context2D::shear(real sh, real sv )
Shear the transformation matrix with \a sh in horizontal direction and \a sv in vertical direction.
*/
static v8::Handle<v8::Value> ctx2d_shear(const v8::Arguments &args)
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::createLinearGradient(real x0, real y0, real x1, real y1)
+ \qmlmethod object QtQuick2::Context2D::createLinearGradient(real x0, real y0, real x1, real y1)
Returns a CanvasGradient object that represents a linear gradient that transitions the color along a line between
the start point (\a x0, \a y0) and the end point (\a x1, \a y1).
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::createRadialGradient(real x0, real y0, real r0, real x1, real y1, real r1)
+ \qmlmethod object QtQuick2::Context2D::createRadialGradient(real x0, real y0, real r0, real x1, real y1, real r1)
Returns a CanvasGradient object that represents a radial gradient that paints along the cone given by the start circle with
origin (x0, y0) and radius r0, and the end circle with origin (x1, y1) and radius r1.
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::createConicalGradient(real x, real y, real angle)
+ \qmlmethod object QtQuick2::Context2D::createConicalGradient(real x, real y, real angle)
Returns a CanvasGradient object that represents a conical gradient that interpolate colors counter-clockwise around a center point (\c x, \c y)
with start angle \c angle in units of radians.
//rects
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::clearRect(real x, real y, real w, real h)
+ \qmlmethod object QtQuick2::Context2D::clearRect(real x, real y, real w, real h)
Clears all pixels on the canvas in the given rectangle to transparent black.
*/
static v8::Handle<v8::Value> ctx2d_clearRect(const v8::Arguments &args)
return args.This();
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::fillRect(real x, real y, real w, real h)
+ \qmlmethod object QtQuick2::Context2D::fillRect(real x, real y, real w, real h)
Paint the specified rectangular area using the fillStyle.
\sa QtQuick2::Context2D::fillStyle
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::fillRect(real x, real y, real w, real h)
+ \qmlmethod object QtQuick2::Context2D::fillRect(real x, real y, real w, real h)
Stroke the specified rectangle's path using the strokeStyle, lineWidth, lineJoin,
and (if appropriate) miterLimit attributes.
// Complex shapes (paths) API
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::arc(real x, real y, real radius, real startAngle, real endAngle, bool anticlockwise)
+ \qmlmethod object QtQuick2::Context2D::arc(real x, real y, real radius, real startAngle, real endAngle, bool anticlockwise)
Adds an arc to the current subpath that lies on the circumference of the circle whose center is at the point (\c x,\cy) and whose radius is \c radius.
\image qml-item-canvas-arcTo2.png
\sa QtQuick2::Context2D::arcTo
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::arcTo(real x1, real y1, real x2, real y2, real radius)
+ \qmlmethod object QtQuick2::Context2D::arcTo(real x1, real y1, real x2, real y2, real radius)
Adds an arc with the given control points and radius to the current subpath, connected to the previous point by a straight line.
To draw an arc, you begin with the same steps your followed to create a line:
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::beginPath()
+ \qmlmethod object QtQuick2::Context2D::beginPath()
Resets the current path to a new path.
*/
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::bezierCurveTo(real cp1x, real cp1y, real cp2x, real cp2y, real x, real y)
+ \qmlmethod object QtQuick2::Context2D::bezierCurveTo(real cp1x, real cp1y, real cp2x, real cp2y, real x, real y)
Adds a cubic Bezier curve between the current position and the given endPoint using the control points specified by (\c cp1x, cp1y),
and (\c cp2x, \c cp2y).
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::clip()
+ \qmlmethod object QtQuick2::Context2D::clip()
Creates the clipping region from the current path.
Any parts of the shape outside the clipping path are not displayed.
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::closePath()
+ \qmlmethod object QtQuick2::Context2D::closePath()
Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting a new path.
The current point of the new path is the previous subpath's first point.
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::fill()
+ \qmlmethod object QtQuick2::Context2D::fill()
Fills the subpaths with the current fill style.
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::lineTo(real x, real y)
+ \qmlmethod object QtQuick2::Context2D::lineTo(real x, real y)
Draws a line from the current position to the point (x, y).
*/
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::moveTo(real x, real y)
+ \qmlmethod object QtQuick2::Context2D::moveTo(real x, real y)
Creates a new subpath with the given point.
*/
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::quadraticCurveTo(real cpx, real cpy, real x, real y)
+ \qmlmethod object QtQuick2::Context2D::quadraticCurveTo(real cpx, real cpy, real x, real y)
Adds a quadratic Bezier curve between the current point and the endpoint (\c x, \c y) with the control point specified by (\c cpx, \c cpy).
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::rect(real x, real y, real w, real h)
+ \qmlmethod object QtQuick2::Context2D::rect(real x, real y, real w, real h)
Adds a rectangle at position (\c x, \c y), with the given width \c w and height \c h, as a closed subpath.
*/
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::roundedRect(real x, real y, real w, real h, real xRadius, real yRadius)
+ \qmlmethod object QtQuick2::Context2D::roundedRect(real x, real y, real w, real h, real xRadius, real yRadius)
Adds the given rectangle rect with rounded corners to the path. The \c xRadius and \c yRadius arguments specify the radius of the
ellipses defining the corners of the rounded rectangle.
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::ellipse(real x, real y, real w, real h)
+ \qmlmethod object QtQuick2::Context2D::ellipse(real x, real y, real w, real h)
Creates an ellipse within the bounding rectangle defined by its top-left corner at (\a x, \ y), width \a w and height \a h,
and adds it to the path as a closed subpath.
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::text(string text, real x, real y)
+ \qmlmethod object QtQuick2::Context2D::text(string text, real x, real y)
Adds the given \c text to the path as a set of closed subpaths created from the current context font supplied.
The subpaths are positioned so that the left end of the text's baseline lies at the point specified by (\c x, \c y).
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::stroke()
+ \qmlmethod object QtQuick2::Context2D::stroke()
Strokes the subpaths with the current stroke style.
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::isPointInPath(real x, real y)
+ \qmlmethod object QtQuick2::Context2D::isPointInPath(real x, real y)
Returns true if the given point is in the current path.
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::fillText(text, x, y)
+ \qmlmethod object QtQuick2::Context2D::fillText(text, x, y)
Fills the given text at the given position.
\sa QtQuick2::Context2D::font
\sa QtQuick2::Context2D::textAlign
return args.This();
}
/*!
- \qmlmethod QtQuick2::Context2D QtQuick2::Context2D::strokeText(text, x, y)
+ \qmlmethod object QtQuick2::Context2D::strokeText(text, x, y)
Strokes the given text at the given position.
\sa QtQuick2::Context2D::font
\sa QtQuick2::Context2D::textAlign
}
/*!
- \qmlmethod QtQuick2::Context2D putImageData(QtQuick2::CanvasImageData imageData, real dx, real dy, real dirtyX, real dirtyY, real dirtyWidth, real dirtyHeight)
+ \qmlmethod object QtQuick2::Context2D::putImageData(QtQuick2::CanvasImageData imageData, real dx, real dy, real dirtyX, real dirtyY, real dirtyWidth, real dirtyHeight)
Paints the data from the given ImageData object onto the canvas. If a dirty rectangle (\a dirtyX, \a dirtyY, \a dirtyWidth, \a dirtyHeight) is provided, only the pixels from that rectangle are painted.
*/
static v8::Handle<v8::Value> ctx2d_putImageData(const v8::Arguments &args)