Graphics
@Js
mixin Graphics
Graphics is used to draw 2D graphics.
Convenience for setting paint to a solid color
Global alpha value used to control opacity for rending
Current paint defines how text and shapes are stroked and filled
Current stroke defines how the shapes are outlined
Current font used for drawing text
Fill an ellipse within the given bounds with the current stroke and paint
Fill a rectangle with rounded corners with the current paint
Convenience to clip the given the rectangle
Draw a the text string with the current paint and font
Draw a line with the current stroke and paint
Fill a rectangle with the current paint
Push the current graphics state onto an internal stack
Translate the coordinate system to the new origin
Pop the graphics stack and reset the state to the the last push
Draw an image at the given coordinate for the top/left corner
Begin a new path operation to stroke, fill, or clip a shape
Clip a rectangle with rounded corners with the current paint
Perform an affine transformation on the coordinate system
Draw a rectangular region of the source image to the drawing surface
Draw a rectangle with rounded corners with the current stroke and paint
Dispose of this graphics context and release underyling OS resources
Draw an ellipse within the given bounds with the current stroke and paint
Get font metrics for the current font
Draw a rectangle with the current stroke and paint
abstract Float : alpha
Global alpha value used to control opacity for rending. The value must be between 0.0 (transparent) and 1.0 (opaue).
abstract This clipRect(Float x, Float y, Float w, Float h)
Convenience to clip the given the rectangle. This sets the clipping area to the intersection of the current clipping region and the specified rectangle.
abstract This clipRoundRect(Float x, Float y, Float w, Float h, Float wArc, Float hArc)
Clip a rectangle with rounded corners with the current paint. The ellipse of the corners is specified by wArc and hArc.
abstract Color : color
Convenience for setting paint to a solid color. If the paint is currently not a solid color, then get returns Paint.asColorPaint.
abstract Void dispose()
Dispose of this graphics context and release underyling OS resources.
abstract This drawEllipse(Float x, Float y, Float w, Float h)
Draw an ellipse within the given bounds with the current stroke and paint.
abstract This drawImage(Image img, Float x, Float y, Float w, Float h)
Draw an image at the given coordinate for the top/left corner. If the width or height does not correspond to the image's natural size then the image is scaled to fit.
abstract This drawImageRegion(Image img, Rect src, Rect dst)
Draw a rectangular region of the source image to the drawing surface. The src rectangle defines the subregion of the source image to use. The dst rectangle identifies the destination location. If the src size does not correspond to the dst size, then the image is scaled to fit.
abstract This drawLine(Float x1, Float y1, Float x2, Float y2)
Draw a line with the current stroke and paint.
abstract This drawRect(Float x, Float y, Float w, Float h)
Draw a rectangle with the current stroke and paint.
abstract This drawRoundRect(Float x, Float y, Float w, Float h, Float wArc, Float hArc)
Draw a rectangle with rounded corners with the current stroke and paint. The ellipse of the corners is specified by wArc and hArc.
abstract This drawText(Str s, Float x, Float y)
Draw a the text string with the current paint and font. The x, y coordinate specifies the left baseline corner of where the text is to be drawn. Technically this is a fill operation similiar to the Canvas fillText function (there is currently no support to stroke/outline text).
abstract This fillEllipse(Float x, Float y, Float w, Float h)
Fill an ellipse within the given bounds with the current stroke and paint.
abstract This fillRect(Float x, Float y, Float w, Float h)
Fill a rectangle with the current paint.
abstract This fillRoundRect(Float x, Float y, Float w, Float h, Float wArc, Float hArc)
Fill a rectangle with rounded corners with the current paint. The ellipse of the corners is specified by wArc and hArc.
abstract Font : font
Current font used for drawing text
abstract FontMetrics metrics()
Get font metrics for the current font
abstract Paint : paint
Current paint defines how text and shapes are stroked and filled
abstract GraphicsPath path()
Begin a new path operation to stroke, fill, or clip a shape.
abstract This pop()
Pop the graphics stack and reset the state to the the last push.
abstract This push(Rect? r)
Push the current graphics state onto an internal stack. Reset the state back to its current state via pop. If r is non-null, the graphics state is automatically translated and clipped to the bounds.
abstract Stroke : stroke
Current stroke defines how the shapes are outlined
abstract This transform(Transform transform)
Perform an affine transformation on the coordinate system
abstract This translate(Float x, Float y)
Translate the coordinate system to the new origin. This call is a convenience for:
transform(Transform.translate(x, y))