Anyone have a Screenshot Example?
BlitzMax Forums/BlitzMax Programming/Anyone have a Screenshot Example?
| ||
The search engine for the site isn't working, and I'm feeling tired and lazy today.. does anyone have some example code for taking screenshots? I'm trying to catalog my progress.. Thanks! |
| ||
ALT + PRINTSCREEN Works for me everytime. |
| ||
I'm thinking he wants a less labour intensive way to do it in his program. unfortunately there are no official image savers yet, this page here might be of some help (along with CreateImage and GrabImage). |
| ||
There is an Imagesaver but it only saves Png format so far. A screenshot function will look like this: Function ScreenshotPNG:Byte(url:String) Local Screen:Timage = CreateImage(GraphicsWidth(),GraphicsHeight()) GrabImage(Screen,0,0) Screentemp:TPixmap = LockImage(Screen) Return SavePixmapPNG(Screentemp,url) End Function Graphics 800,600,0,-1 For i = 1 To 1000 Plot Rnd(0,800),Rnd(0,600) Next FlushMem() Flip test:Byte = ScreenshotPNG("c:\test.png") Print test WaitKey() |
| ||
I'm on a Mac, so ALT+PRINTSCR isn't an option. Thanks Klepto, that's what I was looking for. Thanks Pert. |
| ||
Apple-Shift-3 grabs the screen on a Mac, plus Apple-Shift-4 gives you a box you can draw around stuff. In os/X it saves as a PDF file. You can export from `Preview` to make PNG or other format. |
| ||
Thanks! That helps as well. |
| ||
If you add control to those combos, it copies to the clipboard instead of a file. |