It’s of course possible to capture a screenshot from BlitzMax fullscreen game with video capture programs such Fraps. It can be also done with the in the BlitzMax code of the game. Here’s my little code to do it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
SuperStrict HideMouse Const JPEG_QUALITY:Int = 90 Graphics 640,480,32,1 Local screenpixmap:TPixmap = CreatePixmap(640,480,PF_RGBA8888) While Not KeyHit(KEY_ESCAPE) Cls DrawOval (640 - 32) / 2, (480 - 32) / 2, 32, 32 If KeyHit(KEY_C) Then screenpixmap = GrabPixmap(0,0,640,480) SavePixmapJPeg (screenpixamp,"filename.jpg",JPEG_QUALITY) EndIf Flip Wend End |
One must define a Pixmap to which the screen’s content is grabbed. When the contents are grabbed the pixmap is saved as JPEG picture by name “filename.jpg”.
In this example program the screenshot is taken when key c is pressed and saved as jpeg-file.