public exportImage(filename as String) as Void throws IOException:
Exports the recorded drawing to a BMP, PNG or PDF file.
The destination format is selected from the filename extension. The operation requires a positive painter size and an active GUI backend.
| Parameter | Description |
|---|---|
filename | destination ending in .bmp, .png or .pdf. |
painter = Painter(320, 200)
painter.fillStyle = Color.white()
painter.fillRect(0, 0, painter.width, painter.height)
painter.exportImage("drawing.png")