Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class ArtRenderer
- Object
- ArtRenderer
Paints an ArtDocument into pixels.
Everything is rasterized in software, so blend modes, masks and effects look the same on every port and render in tests without a display. Text is the one exception: it is drawn with the platform’s fonts, so it needs an initialized display and is skipped without one.
Constructors
public ArtRenderer() |
Methods
public static Raster render(ArtDocument doc, double scale) | Renders a whole document. |
public static Image toImage(ArtDocument doc, double scale) | Renders a whole document to an Image. |
public Raster render(ArtDocument doc, Matrix view, int[] clip) | Renders through a view transform into a device rectangle. |
public void renderNode(ArtNode node, Matrix parent, Raster target) | Renders one node (and its children) onto target. |
Inherited methods
Constructor details
ArtRenderer
public ArtRenderer()Method details
render
public static Raster render(ArtDocument doc, double scale)Renders a whole document.
Parameters
docArtDocument- the document
scaledouble- device pixels per document unit
Returns
a raster of the canvas,
ceil(width * scale) by ceil(height * scale)toImage
public static Image toImage(ArtDocument doc, double scale)Renders a whole document to an
Image.Parameters
docArtDocument- the document
scaledouble- device pixels per document unit
render
public Raster render(ArtDocument doc, Matrix view, int[] clip)Renders through a view transform into a device rectangle.
Parameters
docArtDocument- the document
viewMatrix- maps document coordinates to device pixels
clipint[]- the device rectangle to produce, as
x, y, w, h
renderNode
public void renderNode(ArtNode node, Matrix parent, Raster target)Renders one node (and its children) onto
target.Parameters
nodeArtNode- the node
parentMatrix- the transform from the node’s parent space to device pixels
targetRaster- what is painted so far; the node is composited onto it