Skip to content

G2D.SaveImage

boxgaming edited this page May 12, 2023 · 1 revision

Saves an image to the virtual filesystem in PNG format.

Syntax

G2D.SaveImage img&, filepath$

Parameters

  • The img& parameter is the id of the image to save.
  • The filepath$ parameter indicates the location on the virtual file system where the image file will be saved.

Examples

Example1: Save the screen image to a file.

Import G2D From "lib/graphics/2d.bas"

Screen _NewImage(400, 400)

Randomize Timer
Dim i As Integer
For i = 1 To 1000
    Circle (Rnd * _Width, Rnd * _Height), Rnd * 100 + 10, Rnd * 15 + 1
Next i

G2D.SaveImage _Dest, "circles.png"

Clone this wiki locally