Code archives/Graphics/Simple screenshot function
This code has been declared by its author to be Public Domain code.
Download source code
| |||||
Call this function to save a screenshot. It will not overwrite screenshots already taken. | |||||
Function take_screenshot() Local filename:String, padded:String Local num:Int = 0 padded = num While padded.length < 3 padded = "0"+padded Wend filename = "screen"+padded+".png" While FileType(filename) <> 0 num:+1 padded = num While padded.length < 3 padded = "0"+padded Wend filename = "screen"+padded+".png" Wend Local img:tpixmap = GrabPixmap(0,0,GraphicsWidth(),GraphicsHeight()) SavePixmapPNG(img, filename ) Print "Screenshot saved as "+filename EndFunction |
Comments
| ||
Nice, but i like....SaveBuffer(FrontBuffer(),"screen.bmp") |
| ||
Nice, but i like.... That's all very well if you're using B3D |
| ||
Just what I was looking for. Thanks |
| ||
Yes, many thanks!! Very useful for me! |
| ||
excellent.. i modded the command lines to grab a specific area of the desktop. very cool for splash windows then having to use user32 functs skin the window |
| ||
Awesome, thanks! |
Code Archives Forum