GrabSprite()

Syntax

Result = GrabSprite(#Sprite, x, y, Width, Height [, Mode])
Description
Grabs the screen content from the area x,y,Width,Height, and creates a new #Sprite. If #PB_Any is used as '#Sprite' parameter, the new sprite number will be returned as 'Result'.

The 'Mode' parameter is optional and can take the following values:
  0                 : Default mode. Sprite resides in video memory (if possible)
  #PB_Sprite_Memory : Sprite is loaded into main PC memory (for SpecialFX)
  #PB_Sprite_Alpha  : Sprite is 8 bits grayscale and will be used by DisplayAlphaSprite() or DisplayShadowSprite()
  #PB_Sprite_Texture: Sprite is created with 3D support - useful for the CreateSprite3D() command of the Sprite3D library.

Note: GrabSprite() should be always called outside a StartDrawing() : StopDrawing() block.

Supported OS

All

<- FreeSprite() - Sprite Index - InitSprite() ->