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.

Parameters

#Sprite A number to identify the new grabbed sprite. #PB_Any can be used to auto-generate this number.
x, y The position in the screen used to start the grab (in pixels).
Width, Height The size of the grab (in pixels).
Mode (optional) It can be a combination of the following values (with the '|' operator):
  #PB_Sprite_PixelCollision: Add special information to handle pixel collision trough SpritePixelCollision().
  #PB_Sprite_AlphaBlending : Sprite is created with per pixel alpha-channel support, needed for DisplayTransparentSprite().

Return value

Nonzero if the sprite has been grabbed, zero otherwise. If #PB_Any was used for the #Sprite parameter then the generated number is returned on success.

Remarks

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

Supported OS

All

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