This command allows you to use all the drawing commands on a bitmap instead of drawing directly to the screen. The parameter bitmap is the bitmap to be drawn on. If SetDrawingSurface Off is executed, then drawing will be done directly to the screen.
When a SetDrawingSurface command is executed the internal scale (set by SetScale) is reset to 1.0. So if you are using the SetScale command, you will always have to set the scale after executing a SetDrawingSurface command.
Example:
Graphics On
Color 40,40,40
CLS
width = ScreenX()
height = ScreenY()
bitmap = CreateBitmap(width/4, height/4)
' Make the bitmap a green box with two diagonal lines.
SetDrawingSurface bitmap
Color 0,100,0
CLS
ex = GetBitmapWidth(bitmap) - 1
ey = GetBitmapHeight(bitmap) - 1
Color 0,0,0
Line 0,0,ex,ey
Line ex,0,0,ey
Color 100,0,0
Rect 0,0,ex,ey
SetDrawingSurface Off
DrawBitmap bitmap, width/2, height/2
Wait 10000
|