GrabDesktop -- create a brush of the desktop screen (V4.5)
[id] = GrabDesktop(id[, table])
This function can be used to copy the contents of desktop screen into a brush. You have to pass an identifier for the new brush that shall be created by this function. If you pass a Nil identifier, GrabDesktop() will return a handle to the new brush containing the desktop screen to you.

The optional table argument is useful if you only want to grab a portion of the desktop screen. In that case, you can use the optional table argument to define the portion that shall be grabbed.

The optional table argument recognizes the following tags:

X, Y:
Defines the top left corner of the rectangle on the desktop that shall be grabbed by this function. Defaults to 0/0.

Width, Height:
Defines the size of the rectangle that shall be grabbed by this function. Defaults to the size of the desktop.

This tag is only supported in the Amiga versions of Hollywood. It allows you to specify the name of the screen which GrabDesktop() should copy to a brush. By default, GrabDesktop() will always grab the frontmost screen. (V5.3)

identifier of a brush that shall be created by this function or Nil for auto id selection
optional: table specifying the portion of the desktop screen that shall be grabbed (see above)
optional: handle to the newly created brush; this will only be returned if you passed Nil in id
desktop_brush = GrabDesktop(Nil)
DisplayBrush(desktop_brush, 0, 0)
The code above grabs the whole desktop screen to a brush, converts the brush to gray, and then displays it. The result will be a desktop screen that suddenly lost its color information.

Show TOC