ImageBvr Class

Creates an object that represents an image behavior. Much like a bitmap, an image is a two-dimensional picture composed of individual picture elements. Like other behaviors, however, the value of the picture elements can change over time.

Every image behavior consists of an infinite set of two-dimensional points, each representing a picture element and each having color, opacity, and detectability attributes. Colors in an image are defined using color behaviors. Opacity values are number behaviors, and can range in value from 0 through 1, with 0 for fully transparent and 1 for fully opaque. Only points that are "nontransparent" have any visible effect when the image is output or combined with other images.

Points in the image are either detectable or not. If a point is detectable, the image fires a pick event whenever the mouse passes over it.

The bounding box operation is used to construct and compose media, and different types of images and behaviors provide specific bounding boxes. This means, for example, that the bounding box of an image is not defined as the smallest axis-aligned, enclosing region of the nontransparent parts of an image. Instead, bounding boxes are defined on a per-operation basis. This means, for example, that the clipPolygon method has its own definition of a bounding box, defined below.

For more information about behaviors, see the Behavior class.

For relevant methods and fields from the Statics class, see the following topics.

ImageBvr Methods

boundingBox Creates a box behavior that defines the box that encloses all nontransparent portions of the image behavior.
clip Creates a new image behavior by clipping the original image.
clipPolygon Creates a new image behavior by clipping the original image.
crop Creates a new image behavior by cropping the original image.
mapToUnitSquare Creates an image that is mapped to the unit square.
opacity Creates an image behavior in which the opacity value for each point is set to the given number behavior.
tile Creates a new image behavior that consists of the original image tiled (repeated) in all directions.
transform Creates a new image behavior that is the result of applying the given transformation to the points in the original image behavior.
undetectable Creates a new undetectable image behavior from the original image.
newUninitBvr Enables you to refer to an ImageBvr behavior before that behavior has been defined.

boundingBox

ImageBvr Class

Creates a box behavior that defines the box that encloses all nontransparent portions of the image behavior.

Syntax

public Bbox2Bvr boundingBox( );

Return Value

Returns the Bbox2Bvr object.

clip

ImageBvr Class

Creates a new image behavior by clipping the original image. The new image consists of that portion of the original image that is within the region(s) defined by the given matte behavior.

Syntax

public ImageBvr clip( MatteBvr matte );

Parameters

matte
MatteBvr object.

Return Value

Returns the ImageBvr object.

Remarks

The bounding box of an image clipped to a matte is the intersection of the matte's bounding box (the axis-aligned box that surrounds the matte), and the bounding box of the underlying image.

clipPolygon

ImageBvr Class

Creates a new image behavior by clipping the original image. The new image consists of that portion of the original image that is within the closed figure defined by the given point behaviors.

Syntax

public ImageBvr clipPolygon( Point2Bvr[] points );

Parameters

points
An array of Point2Bvr objects representing the endpoints of the line segments that define the figure. If the first and last points are not the same, these points are implicitly connected to close the figure.

Return Value

Returns the ImageBvr object.

Remarks

The bounding box is the intersection of the box surrounding the points of the polygon with the box of the underlying image.

crop

ImageBvr Class

Creates a new image behavior by cropping the original image. The new image consists of the portion of the original image that is within the region given by minPt and maxPt.

Syntax

public ImageBvr crop( Point2Bvr minPt, Point2Bvr maxPt );

Parameters

minPt and maxPt
Point2Bvr objects representing the lower-left and upper-right corners of the box enclosing the portion of the original image to use.

Return Value

Returns the ImageBvr object.

Remarks

The bounding box of a cropped image is the intersection of the crop box and the box of the underlying image.

mapToUnitSquare

ImageBvr Class

Creates an image that is mapped to the unit square. This is a square at coordinates [(0,0) (1,1)].

Syntax

public ImageBvr mapToUnitSquare( );

Remarks

This method is commonly used for images that will be textured because a geometry's texture coordinates generally span the unit square. It is also used for transforming an image into a space where it is easy to manipulate.

opacity

ImageBvr Class

Creates an image behavior in which the opacity value for each point is set to the given number behavior.

Syntax

public ImageBvr opacity( NumberBvr opac );

Parameters

opac
NumberBvr object representing the opacity value. The image is fully opaque if the value is 1, and fully transparent if the value is 0. This parameter can also be of type double.

Return Value

Returns the ImageBvr object.

Remarks

By default, an image's opacity is 1. The bounding box is simply the bounding box of the underlying image itself. Opacity values can range from 0.0 to 1.0. If the corresponding number behavior has a value outside this range, the integer part of the value is discarded and only the fractional part is used.

This attribute composes values. The resulting opacity is the new value times the old value.

tile

ImageBvr Class

Creates a new image behavior that consists of the original image tiled (repeated) in all directions. The bounding box is the infinite bounding box.

Syntax

public ImageBvr tile( );

Return Value

Returns the ImageBvr object.

transform

ImageBvr Class

Creates a new image behavior that is the result of applying the given transformation to the points in the original image behavior.

Syntax

public ImageBvr transform( Transform2Bvr xf );

Parameters

xf
Transform2Bvr object.

Return Value

Returns the ImageBvr object.

Remarks

As an example, you can double the size of the opaque portion of the image that is the result of applying a transformation that scales by 2. The bounding box of a transformed image is determined by applying the transform to the bounding box of the underlying image and then enclosing the resultant quadrilateral with an axis-aligned box.

This attribute composes values.

undetectable

ImageBvr Class

Creates a new undetectable image behavior from the original image.

Syntax

public ImageBvr undetectable( );

Return Value

Returns the ImageBvr object.

newUninitBvr

ImageBvr Class

Enables you to refer to an ImageBvr behavior before that behavior has been defined. With this method you can create the behavior and use it in the definition of other behaviors, but not actually define its contents until some later point. (This is accomplished with the init method, which is available on all behaviors.) The system generates a run-time error if you initialize a non-uninitialized behavior, initialize an uninitialized behavior that has already been initialized, or run an initialized behavior that has not yet been initialized.

Syntax

public static ImageBvr newUninitBvr( );

Return Value

Returns the ImageBvr object.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.