ScreenDump by Ade15th Feb 2005 19:14
|
---|
Summary Save screen display to disk using a sequential numbered file. Description By default it saves out a sequence numbered file in the current directory. This will not overwrite any existing screendumps in the directory as it checks each time it saves the file to determine the next number. The first screendump will be called dump0001.bmp. Code ` This code was downloaded from The Game Creators ` It is reproduced here with full permission ` http://www.thegamecreators.com #constant SCREENDUMP_IMAGE_NUMBER 20000 function ScreenDump() rem determine next screendump filename ScreenDumpFileNumber = 0 repeat inc ScreenDumpFileNumber Filename$ = "dump" if ScreenDumpFileNumber < 10 then Filename$ = Filename$ + "0" if ScreenDumpFileNumber < 100 then Filename$ = Filename$ + "0" if ScreenDumpFileNumber < 1000 then Filename$ = Filename$ + "0" rem the filename extension determines how it is saved, BMP, DIB or JPG Filename$ = Filename$ + str$(ScreenDumpFileNumber) + ".bmp" until (file exist(Filename$) = 0) temp = current bitmap() if temp > 0 then set current bitmap 0 ; rem ensure that we are grabbing the screen image (ie bitmap 0) get image SCREENDUMP_IMAGE_NUMBER, 0, 0, screen width(), screen height(), 1 save image Filename$, SCREENDUMP_IMAGE_NUMBER delete image SCREENDUMP_IMAGE_NUMBER if temp > 0 then set current bitmap temp ; rem ensure that we re-instate the previous bitmap drawing destination endfunction |