klyn.gui.windows.Painter.createPattern
method
public createPattern(image as Object, repetition as String = "repeat") as ImagePattern
Description

Creates a raster image pattern, capturing pixels when a shape is drawn.

Parameters
ParameterDescription
imageRasterImage, BitmapImage, String path or FilePath.
repetitionrepeat, repeat-x, repeat-y or no-repeat.
Returns

A pattern usable as fillStyle or strokeStyle.

Throws
  • ValueException If repetition is invalid.
Example
pattern = painter.createPattern("checker.png", "repeat")