Files
RCBASIC4/doc/files/savebmp.txt
2026-02-26 15:33:51 -06:00

35 lines
523 B
Plaintext

#title SaveBMP [RCBasic Doc]
#header Function SaveBMP(img, file$)
Save an image to a *.bmp file
#code
title$ = "Sprite Test"
w = 640
h = 480
fullscreen = FALSE
vsync = FALSE
OpenWindow( title$, w, h, fullscreen, vsync )
my_canvas = OpenCanvas(w, h, 0, 0, w, h, 1)
Canvas(my_canvas)
SetColor(RGB(255,0, 0))
CircleFill(50, 50, 25)
SetColor(RGB(0, 255, 0))
CircleFill(590, 50, 25)
SetColor(RGB(0, 0, 255))
CircleFill(590, 430, 25)
img = CanvasClip(0, 0, 640, 480)
SaveBMP(img, "test.bmp")
Update()
WaitKey()
#/code