RosettaCodeData/Task/Bitmap/XPL0/bitmap.xpl0

12 lines
513 B
Plaintext

include c:\cxpl\codes; \include 'code' declarations
def Width=180, Height=135, Color=$123456;
int X, Y;
[SetVid($112); \set display for 640x480 graphics in 24-bit RGB color
for Y:= 0 to Height-1 do \fill area with Color one pixel at a time
for X:= 0 to Width-1 do \(this takes 4.12 ms on a Duron 850)
Point(X, Y, Color);
Move(60, 60); HexOut(6, ReadPix(0,0)); \show color of pixel at 0,0
X:= ChIn(1); \wait for keystroke
SetVid(3); \restore display to normal text mode
]