Lingo Dictionary > A-C > crop() (member command) |  |

crop() (member command)

Syntax

    member(whichMember).crop(rectToCropTo)
    crop member whichMember, rectToCropTo

Description

Bitmap command; allows a bitmap cast member to be cropped to a specific size.

You can use `crop` to trim existing cast members, or in conjunction with the picture of the Stage to grab a snapshot and then crop it to size for display.

The registration point is kept in the same location so the bitmap does not move in relation to the original position.

Example

This statement sets an existing bitmap member to a snapshot of the Stage then crops the resulting image to a rectangle equal to sprite 10:

    member("stage image").picture = (the stage).picture
    member("stage image").crop(sprite(10).rect)

See also

`picture (cast member property)`