GetBrushLink -- get a link to a brush (V1.5)
GetBrushLink(id, sourcetype, sourceid[, par])
Hollywood 2.0 Note: Brush links are no longer supported. You can still use this function but it will not create links any more. It will simply create a full copy of the image data; in other words: GetBrushLink() just calls ConvertToBrush().

This function creates a new brush for you which will link data from an other object. Therefore the new brush will be read-only. This means e.g. that you can display or move it, but you cannot change its data (e.g. by calling ScaleBrush() or SelectBrush()).

Your brush is fully dependent on the source object. If you free the source object, your brush will also be freed and is no longer available. Brush links require only little bytes of memory because the graphics data will be linked from the source object.

It is useful to use brush links when you have many objects with the same graphics data and you want to access them as separate brushes (e.g. for convenience reasons). Another good reason for brush links is that you can do a lot of more stuff with brushes than with other objects. For example you could retrieve a link to the first anim frame, then display it with DisplayBrushFX() and then start the anim with PlayAnim(). This would display the anim with a transition effect then.

Sourcetype can be one of the following types:

Get brush links from single anim frames; this type requires the optional argument par which specifies the frame you want to have linked

Get brush link from a background picture

Get brush link from an other brush

Get brush link from a layer (requires layers to be enabled!)

Get brush link from a text object

identifier for the brush to be created
type of the source object (see list above)
identifier of the source object
optional: currently only required for type #ANIM
LoadAnim(1, "MyAnim.gif")
GetBrushLink(1, #ANIM, 1, 1)
PlayAnim(1, #CENTER, #CENTER)
The above code loads the animation "MyAnim.gif", gets a brush link to the first frame, crossfades this frame on to the display and then starts playing the anim. This is how you would display an anim with a transition effect.

Show TOC