public class ImageBvr extends Behavior { // Methods public Bbox2Bvr boundingBox(); public ImageBvr clip(MatteBvr matte); public ImageBvr clipPolygon(Point2Bvr[] points); public ImageBvr crop(Point2Bvr minPt, Point2Bvr maxPt); public ImageBvr mapToUnitSquare(); public ImageBvr opacity(NumberBvr opac); public ImageBvr tile(); public ImageBvr transform(Transform2Bvr xf); public ImageBvr undetectable(); public static ImageBvr newUninitBvr(); }
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 "non-transparent" 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 non-transparent 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.
Creates a box behavior that defines the box that encloses all non-transparent portions of the image behavior.
public Bbox2Bvr boundingBox( );
Returns the Bbox2Bvr object.
Creates a new image behavior by clipping the original image. The new image consists of the portion of the original image that is within the region(s) defined by the given matte behavior. 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.
public ImageBvr clip(
MatteBvr matte
);
Returns the ImageBvr object.
Creates a new image behavior by clipping the original image. The new image consists of the portion of the original image that is within the closed figure defined by the given point behaviors. The bounding box is the intersection of the box surrounding the points of the polygon with the box of the underlying image.
public ImageBvr clipPolygon(
Point2Bvr[] points
);
Returns the ImageBvr object.
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. The bounding box of a cropped image is the intersection of the crop box and the box of the underlying image.
public ImageBvr crop(
Point2Bvr minPt,
Point2Bvr maxPt
);
Returns the ImageBvr object.
Creates an image that is mapped to the unit square. This is a square at coordinates [(0,0) (1,1)]. It 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.
public ImageBvr mapToUnitSquare( );
Creates an image behavior in which the opacity value for each point is set to the given number behavior. By default, an image's opacity is 1. The bounding box is simply the bounding box of the underlying image itself.
public ImageBvr opacity(
NumberBvr opac
);
Returns the ImageBvr object.
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.
Creates a new image behavior that consists of the original image tiled (repeated) in all directions. The bounding box is the infinite bounding box.
public ImageBvr tile( );
Returns the ImageBvr object.
Creates a new image behavior that is the result of applying the given transformation to the points in the original image behavior. For 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.
public ImageBvr transform(
Transform2Bvr xf
);
Returns the ImageBvr object.
This attribute composes values.
Creates a new undetectable image behavior from the original image.
public ImageBvr undetectable( );
Returns the ImageBvr object.
This method allows 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.
public static ImageBvr newUninitBvr( );
Returns the ImageBvr object.
The following methods are defined in the Statics class and are most relevant to objects of type ImageBvr.
public static ImageBvr gradientHorizontal(ColorBvr start, ColorBvr stop, NumberBvr fallOff);
public static ImageBvr gradientPolygon(Point2Bvr[] pts, ColorBvr[] colors);
public static ImageBvr hatchBackwardDiagonal(ColorBvr color, NumberBvr size);
public static ImageBvr hatchCross(ColorBvr color, NumberBvr size);
public static ImageBvr hatchDiagonalCross(ColorBvr color, NumberBvr size);
public static ImageBvr hatchForwardDiagonal(ColorBvr color, NumberBvr size);
public static ImageBvr hatchHorizontal(ColorBvr color, NumberBvr size);
public static ImageBvr hatchVertical(ColorBvr color, NumberBvr size);
public static ImageBvr importImage(URL url);
public static ImageBvr importImageColorKey(URL url, ColorBvr red, ColorBvr green, ColorBvr blue);
public static NumberBvr importMovie(URL url, ImageBvr[] img, SoundBvr[] snd);
public static NumberBvr importMovie(URL url, ImageBvr[] img, SoundBvr[] snd);
public static ImageBvr overlay(ImageBvr i1, ImageBvr i2);
public static ImageBvr overlayArray(ImageBvr[] im);
public static ImageBvr radialGradientSquare(ColorBvr inner, ColorBvr outer, NumberBvr fallOff);
public static ImageBvr solidColorImage(ColorBvr col);
public static ImageBvr stringImage(StringBvr string, FontStyleBvr font);
The following fields are defined in the Statics class and are most relevant to objects of type ImageBvr.
public final static ImageBvr detectableEmptyImage;
public final static ImageBvr emptyImage;
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.