Get a Snapshot of Desktop?

BlitzMax Forums/BlitzMax Programming/Get a Snapshot of Desktop?

Sin of Nature(Posted 2006) [#1]
Hi,

Does anyone know how to grab a screenshot of the desktop (or a portion of it)?

Cheers

Sin


ImaginaryHuman(Posted 2006) [#2]
On Window's you press and hold Ctrl, then press Print Screen. It puts it into the clipboard. Then you can paste it into some application like Paintshop Pro.

On the Mac it's something like Apple-Shift-3, or Apple-Shift-4 to grab an area. Not sure if it's the apple key or the Option key.

As to doing it from within BlitzMax, that's another story.


Eikon(Posted 2006) [#3]
A rough example:
Window:TGadget = CreateWindow("Desktop", 250, 250, ClientWidth(Desktop()), ClientHeight(Desktop()))

dsDC = GetDC(QueryGadget(Window, QUERY_HWND_CLIENT))
dhWnd = GetDesktopWindow()

BitBlt dsDC, 0, 0, ClientWidth(Desktop()), ClientHeight(Desktop()), GetDC(dhWnd), 0, 0, $00CC0020

Repeat
Until WaitEvent() = EVENT_WINDOWCLOSE



Sin of Nature(Posted 2006) [#4]
Thanks Eikon, will give that a try. :)

Sin