Screen Shots

BlitzMax Forums/BlitzMax Programming/Screen Shots

ive done a search and cheacked the code archives but no look ( the one in the code archives dont work)

i need to know how to make screen shots lol so i dont have to do them like this



yes thats running slow but it is a 2048x2048 height map terrain with alot in view

Local p:TPixmap = GrabPixmap(x,y,w,h)
SavePixmapPNG(p,file$)

Something like that

if you use the AltGr button + PrtScn, then you will only capture the active window...
either that, or make some screengrabbing code ingame.. :)

Here's a routine I just knocked together. lables the screenshots uniquely too:

Function screenshot:Int()
	Local p:TPixmap = GrabPixmap( 0, 0, WIDTH, HEIGHT )
	
	Local day:String = CurrentDate()[..2]
	Local month:String
	
	'convert month short name to digit
	Select CurrentDate()[3..6].toUpper()
		Case "JAN"
			month="01"
		Case "FEB"
			month="02"
		Case "MAR"
			month="03"
		Case "APR"
			month="04"
		Case "MAY"
			month="05"
		Case "JUN"
			month="06"
		Case "JUL"
			month="07"
		Case "AUG"
			month="08"
		Case "SEP"
			month="09"
		Case "OCT"
			month="10"
		Case "NOV"
			month="11"
		Case "DEC"
			month="12"
	End Select
			
	Local year:String = CurrentDate()[7..]
	
	Local hours:String = CurrentTime()[..2]
	Local minutes:String = CurrentTime()[3..5]
	Local seconds:String = CurrentTime()[6..]
	
	Local filename:String = "screenshot-"+year+month+day+hours+minutes+seconds+".png"
	
	SavePixmapPNG( p, filename )
	Return Null
End Function


HTH

Muttley