CircuitGizmos

Electronic Products for Creative Minds

  • Home
  • Gizmo Store/Products
  • Documentation/Datasheets
  • Projects/Libraries
  • GizmoBlog
  • Services/Contact
    • Design
    • Contact Gizmo!
  • Your Gizmo Cart
    • Your Account
You are here: Home / GizmoBlog / MMBasic Language / Screen and Graphics (VGA/composite) / PIXEL

PIXEL

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

PRINT @

PSET

SCANLINE

SPRITE

 

 

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

A Ton of Documentation

Open all | Close all

Projects made by Gizmo, Friends, and Members

open all | close all

Recent GizmoBlog Musings

  • Altair 8800 using a ColorMax!
  • Re-energizing the ColorMax, Pt. 3

Visit us!

  • Facebook

Electronic Products for Creative Minds

CircuitGizmos is your source for electronic products that help you create your embedded projects. Here at CircuitGizmos.com you will find a friendly store filled with creative products and all of the documentation that you need to use these gizmos.

We create devices that we believe make electronics fun, but we also know that our products are used for professional designs. For decades we have designed products for commercial, military, and medical industries. Our gizmos here are great for engineers and hobbyists alike.

Copyright © 2008+ CircuitGizmos, L.L.C. All rights reserved

Image already added

Recently Viewed Products

Copyright © 2021 · Generate Pro Theme on Genesis Framework · WordPress · Log in