The rescue is here...
Here's a simple drop-in code you can use to take screenshots. It's great because it will actually place the image in the folder next to your game executable, and it will increment the file name if you make more screenshots.
Takes the work right out of it. All you gotta do is call the function.
`Captures Screenshot
Function Debug_SaveScreen()
`Setup variables
ImgNum = Media_GetFreeObj(0)
FileNum = 0
MyFlag = 0
`figure out what the file name will be.
For I = 1 to 13000
If MyFlag = 0
strNumber$ = Str$(i)
While (len(strNumber$) < 6)
strNumber$ = "0" + strNumber$
EndWHile
If File Exist(strNumber$ + ".bmp") = 0
MyFlag = 1
FileNum = I
EndIf
EndIf
Next i
`Grab the entire screen and save it.
If FileNum > 0
GET IMAGE ImgNum, 0, 0, Screen Width(), Screen Height(), 3
SAVE IMAGE strNumber$ + ".bmp", ImgNum
EndIf
`clean up
Media_DeleteObject(ImgNum)
EndFunction
`Deletes Image/Object/Sprite
Function Media_DeleteObject(MyObject)
if MyObject > 0
If Object Exist(MyObject) then Delete Object MyObject
If Sprite Exist(MyObject) then Delete Sprite MyObject
If Image Exist(MyObject) then Delete Image MyObject
Endif
EndFunction
`Gets the first available free Image/Object/Sprite index.
`Or Pass a number to make it skip indexes.
Function Media_GetFreeObj(MyCount)
RetVal = 1
While (MyCount => 0)
Repeat
RetVal = RetVal + 1
Until Object Exist(RetVal) = 0 And Image Exist(RetVal) = 0 And Sprite Exist(RetVal) = 0
MyCount = MyCount - 1
EndWhile
EndFunction RetVal
