PIXEL(x,y) = color
Set a pixel on the VGA or composite screen to a color or inverted (if value is -1).
PIXEL( x, y )
PIXEL( x, y ) returns the value of a pixel on the VGA or composite screen. Zero is off, 1 is on.
PIXEL command example output.
PIXEL example code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
MODE 3 CLS FOR a = 1 to 50 OVAL( (RND*80)+10, (RND()*460)+10, (RND()*410)+10, (RND()*2)+.25, (RND()*6)+1 ) NEXT a SUB OVAL(oval_radius, oval_x, oval_y, oval_aspect, oval_color) FOR degr = 1 TO 360 angle = ( degr / 57.29 ) x = ( oval_radius * COS( angle ) ) * oval_aspect y = oval_radius * SIN( angle ) PIXEL( x + oval_x, y + oval_y ) = oval_color NEXT degr END SUB |
Two outputs of program that reads the text on screen and makes a larger version using small circles for each pixel.
PIXEL reading example code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
MODE 3 CLS PRINT "Beginning Maximite" PRINT "Programming & Interfacing" PRINT "with the CircuitGizmos" PRINT "CGMMSTICK and CGCOLORMAX" PRINT PRINT "www.circuitgizmos.com" FOR a = 0 to 170 FOR b = 0 to 72 state = PIXEL(a, b) IF state <> 0 THEN CIRCLE (10+3*a,100+(3*b)), 2, YELLOW, F ' Alternate image 'CIRCLE (10+3*a,100+(3*b)), 1, RND()*7+1, F ENDIF NEXT b NEXT a |
VGA screen resolution is 480 horizontal by 432 vertical in modes 1-3, and 240×416 in mode 4. PAL composite is 304 by 216 and NTSC composite is 304 by 180.
See also:
BLIT
CIRCLE
CLR$
CLS
COLOR
LINE
LOCATE
MM.HPOS
MM.HRES
MM.VPOS
MM.VRES
MODE
POS
PRESET
PRINT @
PSET
SCANLINE
SPRITE
Leave a Reply