Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
34
Task/Bitmap/BBC-BASIC/bitmap.basic
Normal file
34
Task/Bitmap/BBC-BASIC/bitmap.basic
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
Width% = 200
|
||||
Height% = 200
|
||||
|
||||
REM Set window size:
|
||||
VDU 23,22,Width%;Height%;8,16,16,128
|
||||
|
||||
REM Fill with an RGB colour:
|
||||
PROCfill(100,150,200)
|
||||
|
||||
REM Set a pixel:
|
||||
PROCsetpixel(100,100,255,255,0)
|
||||
|
||||
REM Get a pixel:
|
||||
rgb% = FNgetpixel(100,100)
|
||||
PRINT RIGHT$("00000" + STR$~rgb%, 6)
|
||||
END
|
||||
|
||||
DEF PROCfill(r%,g%,b%)
|
||||
COLOUR 1,r%,g%,b%
|
||||
GCOL 1+128
|
||||
CLG
|
||||
ENDPROC
|
||||
|
||||
DEF PROCsetpixel(x%,y%,r%,g%,b%)
|
||||
COLOUR 1,r%,g%,b%
|
||||
GCOL 1
|
||||
LINE x%*2,y%*2,x%*2,y%*2
|
||||
ENDPROC
|
||||
|
||||
DEF FNgetpixel(x%,y%)
|
||||
LOCAL col%
|
||||
col% = TINT(x%*2,y%*2)
|
||||
SWAP ?^col%,?(^col%+2)
|
||||
= col%
|
||||
Loading…
Add table
Add a link
Reference in a new issue