Class ArtRenderer
java.lang.Object
com.codename1.art.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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Rasterrender(ArtDocument doc, double scale) Renders a whole document.render(ArtDocument doc, Matrix view, int[] clip) Renders through a view transform into a device rectangle.voidrenderNode(ArtNode node, Matrix parent, Raster target) Renders one node (and its children) ontotarget.static ImagetoImage(ArtDocument doc, double scale) Renders a whole document to anImage.
-
Constructor Details
-
ArtRenderer
public ArtRenderer()
-
-
Method Details
-
render
Renders a whole document.
Parameters
doc: the documentscale: device pixels per document unit
Returns
a raster of the canvas,
ceil(width * scale)byceil(height * scale) -
toImage
Renders a whole document to an
Image.Parameters
doc: the documentscale: device pixels per document unit
-
render
Renders through a view transform into a device rectangle.
Parameters
doc: the documentview: maps document coordinates to device pixelsclip: the device rectangle to produce, asx, y, w, h
-
renderNode
-