; CaptureScreenshot Example ; ------------------------- ; Requires Extended mode. Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,1,-6 light=CreateLight() RotateEntity light,45,45,0 ; A trophy worth photographing trophy=CreateSphere(24) EntityColor trophy,255,210,40 While Not KeyDown(1) ; Space arms a screenshot of the NEXT presented frame If KeyHit(57) Then CaptureScreenshot "capture_example.png" TurnEntity trophy,0.5,1.5,0 ; Arrow keys move the camera If KeyDown(200) Then MoveEntity camera,0,0,0.1 If KeyDown(208) Then MoveEntity camera,0,0,-0.1 If KeyDown(203) Then TurnEntity camera,0,1,0 If KeyDown(205) Then TurnEntity camera,0,-1,0 RenderWorld Text 0,0,"Arrow keys: move camera Space: screenshot Esc: exit" ; CaptureStatus reports 0 idle, 1 armed, 2 saved, -1 failed Select CaptureStatus() Case 1 Text 0,20,"Armed - the next Flip is saved to capture_example.png" Case 2 Text 0,20,"Saved capture_example.png in this example's directory" Default Text 0,20,"Press Space to save capture_example.png" End Select If CaptureError()<>"" Then Text 0,40,CaptureError() Flip Wend End