'// QB GFX Tutorial (c) 98 by RokFOX '`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ '// This file is included along with QB-GFX Issue #1 '// You can contact me via email: RokFOX@mail.tfz.net '// or throught my DCCD server (to know more about it check out my webpage) '// ADDRESS: DCCDRokFOX.dyn.ml.org '// PORT: 1024 '// USER: Guest '// PASS: Guest '// - '// Get last updates and new issues at: http://surf.to/RokFOX ' SCREEN 13 '--> 1 <-- Sets screen mode to 320*200; 256 colors RANDOMIZE TIMER DIM SHARED Picture(1251) AS INTEGER 'The array which will hold the picture DIM SHARED LoadPicture(1251) AS INTEGER, ArraySize AS INTEGER COLOR 11 'Sets fonts color to 11 ArraySize = 1251 '--> 2 <-- The below code draws a random picture FOR y% = 1 TO 50 FOR x% = 1 TO 50 PSET (x%, y%), RND * 256 NEXT NEXT LOCATE 8: PRINT "a)  Image generated !" GET (1, 1)-(50, 50), Picture '--> 3 <-- Stores the generated image to an array PRINT "Press any key to load it" a$ = INPUT$(1) PUT (1, 80), Picture 'Put the picture on the screen LOCATE 18: PRINT "b)  Picture loaded from memory!" PRINT "Now hit anykey to save it to 'your.pic'" a$ = INPUT$(1) OPEN "your.pic" FOR BINARY AS #1 'We'll save our pic into this file FOR p% = 0 TO ArraySize PUT #1, , Picture(p%) '--> 4 <-- Saves the picture array to 'your.pic' NEXT CLOSE #1 PRINT PRINT "c) Picture saved to file: 'your.pic'" PRINT "Press anykey to load it from: 'your.pic'" a$ = INPUT$(1) LOCATE 1, 12: PRINT "d) Loading: 'your.pic'  ..." OPEN "your.pic" FOR BINARY AS #1 'Opens the file to load the pic FOR p% = 0 TO ArraySize GET #1, , LoadPicture(p%) '--> 5 <-- Loads the array from file NEXT CLOSE #1 PUT (230, 11), LoadPicture '--> 6 <-- Put the picture on the screen LOCATE 9, 29: PRINT "Loaded !"