## DAImage Class

Creates a DAImage object that represents a (potentially) animated image. Much like a bitmap, an image is a two-dimensional picture composed of individual picture elements. However, because it can be animted, the value of the picture elements can change over time.

Every DAImage object 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 DAColor objects. Opacity values are DANumber objects, 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 class inherits from DABehavior.

- DAImage Functions
- Relevant Functions from the DAStatics Class
- Relevant properties from the DAStatics Class

### DAImage Functions

BoundingBox

Clip

ClipPolygonImage

Crop

MapToUnitSquare

OpacityAnim

Opacity

Pickable

PickableOccluded

Tile

Transform

Undetectable

####

BoundingBox

DAImage Class

Creates a DABbox2 object that defines the box that encloses all non-transparent portions of the DAImage object.

imageObj.BoundingBox

##### Return Values

Returns the DABbox2 object.

####

Clip

DAImage Class

Creates a DAImage 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.

imageObj.Clip(
matte
)

##### Parameters

matte
  The DAMatte object.

##### Return Values

Returns the DAImage object.

####

ClipPolygonImage

DAImage Class

Creates a DAImage object 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 DAPoint2 objects. The bounding box is the intersection of the box surrounding the points of the polygon with the box of the underlying image.

imageObj.ClipPolygon(
points
)

##### Parameters

points
  The array (variant) of DAPoint2 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 Values

Returns the DAImage object.

####

Crop

DAImage Class

Creates a DAImage object 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.

imageObj.Crop(
minPt,
maxPt
)

##### Parameters

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

##### Return Values

Returns the DAImage object.

####

MapToUnitSquare

DAImage Class

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.

imageObj.MapToUnitSquare

##### Return Values

Returns the DAImage object.

####

OpacityAnim

DAImage Class

Creates a DAImage object in which the opacity value for each point is set to the given animated number (DANumber object). By default, an image's opacity is 1 (completely opaque). The bounding box is simply the bounding box of the underlying image itself.

imageObj.OpacityAnim(
opac
)

##### Parameters

opac
  The DANumber object representing the opacity value. The image is fully opaque if the value is 1, and fully transparent if the value is 0. This must be an animated number.

##### Return Values

Returns the DAImage object.

##### Remarks

Opacity values can range from 0.0 (no opacity) to 1.0 (completely opaque). 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 function composes values. The resulting opacity is the new value times the old value.

####

Opacity

DAImage Class

Same as OpacityAnim except that opac is a non-animated number (a double).

imageObj.Opacity(
opac
)

####

Pickable

DAImage Class

Makes a DAImage object pickable. Use this function along with the returned DAPickableResult object to create a reactive behavior (This means that, when the mouse is in the pickable area, an event occurs).

The behavior of a "pickable" image is identical to that of an ordinary image until the mouse is in the pickable region and there are no geometries (other than Undetectable ones) between it and the mouse. Then, an event (created in DAPickableResult) occurs.

imageObj.Pickable( )

##### Return Values

Returns the DAPickableResult object.

##### See Also

PickableOccluded

####

PickableOccluded

DAImage Class

Makes a DAImage object pickable when there are other images between it and the mouse. This means that the pickable image will still get the event even if the mouse is on the occluding image.

imageObj.PickableOccluded( )

##### Return Values

Returns the DAPickableResult object.

##### See Also

Pickable

####

Tile

DAImage Class

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

imageObj.Tile( )

##### Return Values

Returns the DAImage object.

####

Transform

DAImage Class

Creates a DAImage object that is the result of applying the given transformation to the points in the original image. For example, you can double the size of the opaque portion of the image by 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.

imageObj.Transform(
xf
)

##### Parameters

xf
  The DATransform2 object applied to the original image.

##### Return Values

Returns the DAImage object.

##### Remarks

This function composes values. The resulting transformation is the new value applied to the old value.

####

Undetectable

DAImage Class

Creates an undetectable DAImage from the original image.

imageObj.Undetectable

##### Return Values

Returns the DAImage object.

### Relevant Functions from the DAStatics Class

The following functions are defined in the DAStatics class and are most relevant to objects of type DAImage.

lib.GradientHorizontalAnim(start, stop, power)

lib.GradientHorizontal(start, stop, power)

lib.GradientPolygon(pts, colors)

lib.GradientSquare(lowerLeft, upperLeft, upperRight, lowerRight)

lib.HatchBackwardDiagonalAnim(color, size0

lib.HatchBackwardDiagonal(color, size)

lib.HatchCrossAnim(color, size)

lib.HatchCross(color, size)

lib.HatchDiagonalCrossAnim(color, size)

lib.HatchDiagonalCross(color, size)

lib.HatchForwardDiagonalAnim(color, size)

lib.HatchForwardDiagonal(color, size)

lib.HatchHorizontalAnim(color, size)

lib.HatchHorizontal(color, size)

lib.HatchVerticalAnim(color, size)

lib.HatchVertical(color, size)

lib.ImportImage(url)

lib.ImportImageAsync(url, imgStandIn)

lib.ImportImageAsyncColorKey(url, imgStandIn, red, green, blue)

lib.ImportImageColorKey(url, red, green, blue)

lib.ImportMovie(url)

lib.ImportMovieAsync(url, imgStandIn, sndStandIn)

lib.Overlay(i1, i2)

lib.OverlayArray(im)

lib.RadialGradientPolygonAnim(inner, outer, points, power)

lib.RadialGradientPolygon(inner, outer, points, power)

lib.RadialGradientRegularPolyAnim(inner, outer, edges, power)

lib.RadialGradientRegularPoly(inner, outer, edges, power)

lib.RadialGradientSquareAnim(inner, outer, power)

lib.RadialGradientSquare(inner, outer, power)

lib.SolidColorImage( col)

lib.StringImageAnim(string, font)

lib.StringImage(string, font)

### Relevant properties from the DAStatics Class

The following properties are defined in the DAStatics class and are most relevant to objects of type DAImage.

lib.DetectableEmptyImage

lib.EmptyImage

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.