ScriptBasic does graphics! Here is a quick test of the CD (Canvas Draw) API in action.
IMPORT iup.bas
Iup::Open()
ican = Iup::Canvas()
Iup::SetAttribute(ican, "RASTERSIZE", "800x600")
Iup::SetAttribute(ican, "BORDER", "NO")
dlg = Iup::Dialog(Iup::Vbox(ican))
Iup::SetAttribute(dlg, "TITLE", "Mandelbrot Set")
Iup::Map(dlg)
ccan = CD::CreateCanvas(CD::ContextIup(), ican)
Iup::Show(dlg)
przelx = 3 / 800
przely = 2 / 600
FOR x = 1 TO 800
FOR y = 1 TO 600
a = 0
b = 0
c = 0
x2 = (przelx * x) - 2
y2 = (przely * y) - 1
petla:
a2 = a * a - b * b
b2 = 2 * a * b
a = a2 + x2
b = b2 + y2
z = a * a + b * b
IF z < 4 AND c < 255 THEN
c = c + 1
GOTO petla
END IF
IF c = 255 THEN
pixclr = CD::EncodeColor(0, 0, 0)
ELSE
g = 255 - c
pixclr = CD::EncodeColor(g, g, g)
' Color version
' pixclr = (g+64) * g * (g+16)
END IF
CD::CanvasPixel(ccan, x, y, pixclr)
NEXT y
NEXT x
Iup::MainLoop()
Iup::Close()
END