'===================================================================== ' QuickBASIC Simple Graphics '===================================================================== 'By: Michael Cooney 'stalfos45@hotmail.com 'http://blif.tripod.com '--------------------------------------------------------------------- ' Ok, so you've mastered programming text applications in QBASIC 'and your ready to start learning grahpics to enhace your programs. 'Well you've come to the right place. ' Let's start with the LINE command. CLS SCREEN 13 LINE (10, 15)-(10, 100), 1 ' The first line clears the screen, the second sets us in the 'screen mode 13 (320x200 resolution, 256 colors) and the third line is 'the important stuff. Inside the first brackets are the first x and y 'coordinates (where the line will start) and inside the second 'brackets are the x and y coordinates where the line will stop. The 1 'after the brackets tells the color, which is blue (see the bottom of 'this file for a color chart) But that's not all for the LINE command 'just yet. LINE (50, 50)-(60, 60), 2, B 'The B stands for box and now the 'first set of brackets tells us the 'coordinates of the top left corner 'of the box and the second brackets 'tells the bottom right coordinates. LINE (80, 80)-(120, 120), 3, BF 'BF stands for Box Fill and now a 'filled box will be displayed 'instead of just an outline. ' Now comes the circle command. CIRCLE (150, 150), 10, 4 'It's a bit simpler than LINE. The 'brackets give the coordinates of the 'center of the circle, the first 'number tells the size of the radius '(in pixels) and the last number 'tells the color. 'But how do we fill the circle? Glad 'you asked. PAINT (150, 150), 5, 4 'With the PAINT command. The 5 is the 'color that will be used to fill and 'the 4 is the color to fill up to. 'That is when the PAINT hits 'something that is the color 4 (red) 'it will stop filling. ' Now all that's left is PSET. This command just places a single 'pixel at your specified coordinates and color on the screen. PSET (300, 199), 1 ' Here's a nifty little program to try: 'CLS 'DO 'PSET (RND * 320, RND * 200), RND * 256 'LOOP ' Now here's the color chart I promised: ' ' Number Color Number Color '---------------------- ---------------------- ' 0 Black 8 Grey ' 1 Blue 9 Light Blue ' 2 Green 10 Light Green ' 3 Cyan 11 Light Cyan ' 4 Red 12 Light Red ' 5 Magenta 13 Light Magenta ' 6 Brown 14 Yellow ' 7 White 15 Bright White ' Thanks for reading, ' Michael Cooney