|
Before you can show graphics images on the screen, you must call the SCREEN command. SCREEN sets the graphics mode. The following program uses graphics mode 13 (320x200) to display a line, then returns back to text mode:
' This starts at 10 pixels from the left, 10 from ' the top and goes to point (100, 100): LINE (10, 10)-(100, 100) WHILE INKEY$ = "": WEND ' Waits until a key is pressed SCREEN 0 ' Returns to text mode You can also draw a colored line.
LINE (10, 10)-(100, 100), 192 ' Dark green WHILE INKEY$ = "": WEND SCREEN 0 To draw a single pixel, use PSET.
PSET (160, 100) WHILE INKEY$ = "": WEND SCREEN 0 The following displays a circle at (160, 100) with a radius of 50:
CIRCLE (160, 100), 50 WHILE INKEY$ = "": WEND SCREEN 0 Finally, to display a square, use LINE.
LINE (10, 10)-(100, 100), 192, B ' Notice the B WHILE INKEY$ = "": WEND SCREEN 0 Feel free to distribute this tutorial, upload it to your website, link to it from your site, etc. http://www.geocities.com/progsharehouse/qbtutor Mirror: http://development.freeservers.com/qbtutor |