gradientHorizontal Creates an image behavior that smoothly interpolates between the start and stop colors. gradientPolygon Creates a polygon from an array of points and an array of colors. gradientSquare Creates an image behavior with a square color wash. The image is a unit-sized square, centered at the origin, reaching from [-0.5, -0.5] to [0.5, 0.5]. hatchBackwardDiagonal Creates backward diagonal (lines that slant from right to left) hatch marks. hatchCross Creates cross-hatched markings. hatchDiagonalCross Creates diagonally criss-crossed hatch marks. hatchForwardDiagonal Creates forward diagonal (lines that slant from left to right) hatch marks. hatchHorizontal Creates horizontal hatch lines. hatchVertical Creates vertical hatch lines. importImage(url) Creates an image behavior by synchronously importing the given bitmap. importImage(url, imgStandIn, ev, progress, size) Creates an image behavior by asynchronously importing the given bitmap. importImageColorKey(url, red, green, blue) Allows a particular color in the synchronously imported image, specified by an RGB value, to be treated as transparent. importImageColorKey(url, imgStandIn, ev, progress, size, red, green, blue) Allows a particular color in the asynchronously imported image, specified by an RGB value, to be treated as transparent. importMovie(url, img, snd) Downloads a movie synchronously. importMovie(url, img, snd, imgStandIn, sndStandIn, ev, progress, size) Imports a movie asynchronously. overlay Creates an image behavior by laying the image behavior i1 over the image behavior i2. overlayArray Creates an image behavior by layering the ImageBvr objects. radialGradientPolygon Creates an image behavior that is a regular polygon with a radial fill. radialGradientRegularPoly Creates an image behavior that is a regular, gradient polygon with the specified number of sides (there must be at least 3) and a radial fill. radialGradientSquare Creates an image behavior with a square radial fill. The image is a unit-sized square, centered at the origin, reaching from [-0.5, -0.5] to [0.5, 0.5]. solidColorImage Creates an image behavior and applies the given color behavior to all points in the image. stringImage Constructs an ImageBvr object from a StringBvr object and a FontStyleBvr object.
Creates an image behavior that smoothly interpolates between the start and stop colors. Colors start on the left and go toward the right, based on the power specified by fallOff. The extent of the generated image is [-0.5,-0.5] to [0.5,0.5].
Syntax
public static ImageBvr gradientHorizontal( ColorBvr start, ColorBvr stop, NumberBvr fallOff );
Parameters
- start
- ColorBvr object representing the first color of the gradient fill.
- stop
- ColorBvr object representing the final color of the gradient fill.
- fallOff
- NumberBvr object used to control how rapidly one color transitions into another. A value of 1 is a linear transition. For 0 < power < 1 the transition occurs rapidly, while power > 1 means that the transition occurs more slowly. For example, if you are transitioning from red to blue, and power = 2, you will see a great deal of red in the gradient fill. On the other hand, if power = 0.5 (the inverse of 2), you will see very little red. If power = 0, you will see only blue. This parameter can also be of type double.
Return Value
Returns the ImageBvr object.
Creates a polygon from an array of points and an array of colors. The polygon has a smooth interpolation between the colors at the vertices. This interpolation is in RGB space. The image is transparent and unpickable outside the polygon. The polygon must be convex and fanned, with at least 3 vertices. The tessellation into triangles occurs by fanning around the first vertex. If, for example, the first triangle is from vertices [0, 1, 2], the second is from [0, 2, 3], and so on. The tessellation determines how the color interpolation is done. The bounding box is the box surrounding the points of the polygon.
Syntax
public static ImageBvr gradientPolygon( Point2Bvr[] pts, ColorBvr[] colors );
Parameters
- pts
- Array of points that determine the polygon's vertices.
- colors
- Array of colors corresponding to the vertices.
Return Value
Returns the ImageBvr object.
Creates an image behavior with a square color wash. The image is a unit-sized square, centered at the origin, reaching from [-0.5, -0.5] to [0.5, 0.5]. The image contains the specified colors in the specified corners. The gradient fills are determined by bilinearly interpolating between these specified colors. (This means that, rather than being simply a four-cornered polygon, it is a polygon with four corners plus a point in the middle that is the average of the four colors.) The image is transparent and unpickable outside of this region. The interpolation is in RGB space. The bounding box is a box from (-0.5, -0.5) to (0.5, 0.5).
Syntax
public static ImageBvr gradientSquare( ColorBvr lowerLeft, ColorBvr upperLeft, ColorBvr upperRight, ColorBvr lowerRight );
Parameters
- lowerLeft
- Color in the lower-left corner of square.
- upperLeft
- Color in the upper-left corner of the square.
- upperRight
- Color in the upper-right corner of the square.
- lowerRight
- Color in the lower-right corner of the square.
Return Value
Returns the ImageBvr object.
Creates backward diagonal (lines that slant from right to left) hatch marks. All hatches fit in a box, of dimension size, that is infinitely tiled. For perpendicular hatches, the size of the box is twice the distance between the hatch lines. By default, hatch marks are black and appear on a transparent background.
Syntax
public static ImageBvr hatchBackwardDiagonal( ColorBvr color NumberBvr size );
Parameters
Return Value
Returns the ImageBvr object.
Creates cross-hatched markings. This method can be thought of as a combination of the hatchVertical and the hatchHorizontal methods. All hatches fit in a box, of dimension size, that is infinitely tiled. For perpendicular hatches, the size of the box is twice the distance between the hatch lines. By default, hatch marks are black and appear on a transparent background.
Syntax
public static ImageBvr hatchCross( ColorBvr color, NumberBvr size );
Parameters
Return Value
Returns the ImageBvr object.
Creates diagonally criss-crossed hatch marks. All hatches fit in a box, of dimension size, that is infinitely tiled. For perpendicular hatches, the size of the box is twice the distance between the hatch lines. By default, hatch marks are black and appear on a transparent background.
Syntax
public static ImageBvr hatchDiagonalCross( ColorBvr color, NumberBvr size );
Parameters
Return Value
Returns the ImageBvr object.
Creates forward diagonal (lines that slant from left to right) hatch marks. All hatches fit in a box, of dimension size, that is infinitely tiled. For perpendicular hatches, the size of the box is twice the distance between the hatch lines.
Syntax
public static ImageBvr hatchForwardDiagonal( ColorBvr color, NumberBvr size );
Parameters
Return Value
Returns the ImageBvr object.
Creates horizontal hatch lines. All hatches fit in a box, of dimension size, that is infinitely tiled. For perpendicular hatches, the size of the box is twice the distance between the hatch lines. By default, hatch marks are black and appear on a transparent background.
Syntax
public static ImageBvr hatchHorizontal( ColorBvr color, NumberBvr size );
Parameters
Return Value
Returns the ImageBvr object.
Creates vertical hatch lines. All hatches fit in a box, of dimension size, that is infinitely tiled. For perpendicular hatches, the size of the box is twice the distance between the hatch lines. By default, hatch marks are black and appear on a transparent background.
Syntax
public static ImageBvr hatchVertical( ColorBvr color, NumberBvr size );
Parameters
Return Value
Returns the ImageBvr object.
Creates an image behavior by synchronously importing the given bitmap.
Syntax
public static importImage( URL url );
Parameters
- url
- Fully qualified path of the image to be downloaded. This parameter is of type java.net.URL.
Return Value
Returns the ImageBvr object.
Remarks
The pixels of the bitmap are mapped to points in the image such that the center of the bitmap is placed at (0,0). The extent of the points affected depends on the width and height of the bitmap in pixels and the resolution of the bitmap in pixels per meter. The bounding box of an imported image is calculated as follows: If the pixel dimensions are W´H, and given that:
halfWidthMeters = Statics.pixel * W/2; halfHeightMeters = Statics.pixel * H/2;then the bounding box will be (-halfWidthMeters, -halfHeightMeters) to (halfWidthMeters, halfHeightMeters) with the resultant image centered at the origin.
Synchronous loads are blocking calls, which means that ticking will not continue on any model until all synchronous downloads are completed. These downloads should be small and listed before asynchronous downloads. Use asynchronous downloads for more complex images and sounds. See below for a description of the asynchronous import method.
The file formats that can be imported are .PNG, .JPG, .BMP, and .GIF.
See Also
Creates an image behavior by asynchronously importing the given bitmap.
Syntax
public static ImageBvr importImage( URL url, ImageBvr imgStandIn, DXMEvent[] ev, NumberBvr[] progress, NumberBvr[] size );
Parameters
- url
- Fully qualified path of the image to be downloaded. This parameter is of type java.net.URL.
- imgStandIn
- Image to use while the contents at url are still being downloaded. This argument cannot be null, however, the image can be empty.
- ev
- Event to trigger once the download is complete. This argument can be null.
- progress
- NumberBvr that goes from 0 to 1, tracking the progress of the download. For files downloaded via http, progress is reported as the percentage of the file that has been downloaded. Other protocols, the value may simply start at 0 and change to 1 once the download is complete. This argument can be null.
- size
- NumberBvr that is the size of the image, in bytes. The value begins at -1 and will change to the true size if it is available. This argument can be null.
Return Value
Returns the ImageBvr object.
Remarks
The pixels of the bitmap are mapped to points in the image such that the center of the bitmap is placed at (0,0). The extent of the points affected depends on the width and height of the bitmap in pixels and the resolution of the bitmap in pixels per meter. The bounding box of an imported image is calculated as follows: If the pixel dimensions are W´H, and given that:
halfWidthMeters = Statics.pixel * W/2; halfHeightMeters = Statics.pixel * H/2;then the bounding box will be (-halfWidthMeters, -halfHeightMeters) to (halfWidthMeters, halfHeightMeters) with the resultant image centered at the origin.
Asynchronous downloads should be listed after synchronous ones and used for more complex sounds and images.
The file formats that can be imported are .PNG, .JPG, .BMP, and .GIF.
See Also
Enables a particular color in the synchronously imported image, specified by an RGB value, to be treated as transparent.
Syntax
public static ImageBvr importImageColorKey( URL url, ColorBvr red, ColorBvr green, ColorBvr blue );
Parameters
- url
- Path (a string) of the image to be downloaded.
- red
- ColorBvr red component, expressed as a value ranging from 0 to 255.
- green
- ColorBvr green component, expressed as a value ranging from 0 to 255.
- blue
- ColorBvr blue component, expressed as a value ranging from 0 to 255.
Return Value
Returns the ImageBvr object.
Remarks
The file formats that can be imported are .PNG, .JPG, .BMP, and .GIF.
See Also
Allows a particular color in the asynchronously imported image, specified by an RGB value, to be treated as transparent.
Syntax
public static ImageBvr importImage( URL url, ImageBvr imgStandIn, DXMEvent[] ev, NumberBvr[] progress, NumberBvr[] size, ColorBvr red, ColorBvr green, ColorBvr blue );
Parameters
- url
- Path (a string) of the image to be downloaded.
- imgStandIn
- Image to use while the contents at url are still being downloaded. This argument cannot be null, however, the image can be empty.
- ev
- Event to trigger once the download is complete. This argument can be null.
- progress
- NumberBvr that goes from 0 to 1, tracking the progress of the download. For files downloaded via http, progress is reported as the percentage of the file that has been downloaded. Other protocols, the value may simply start at 0 and change to 1 once the download is complete. This argument can be null.
- size
- NumberBvr that is the size of the image, in bytes. The value begins at -1 and will change to the true size if it is available. This argument can be null.
- red
- ColorBvr red component, expressed as a value ranging from 0 to 255.
- green
- ColorBvr green component, expressed as a value ranging from 0 to 255.
- blue
- ColorBvr blue component, expressed as a value ranging from 0 to 255.
Return Value
Returns the ImageBvr object.
Remarks
The file formats that can be imported are .PNG, .JPG, .BMP, and .GIF.
See Also
Downloads a movie synchronously. Synchronous loads are blocking calls, which means that ticking will not continue on any model until all synchronous downloads are completed. These downloads should be small and listed before asynchronous downloads. Use asynchronous downloads for more complex images and sounds. See below for a description of the asynchronous import method.
The image portion of a movie has the same bounding box and placement as a static image such as a PNG or JPEG.
Syntax
public static NumberBvr importMovie( URL url, ImageBvr[] img, SoundBvr[] snd );
Parameters
- url
- Fully qualified path of the movie to be downloaded. This parameter is of type java.net.URL.
- img
- Image portion of the movie (passed by reference).
- snd
- Sound portion of the movie (passed by reference).
Return Value
Returns the NumberBvr object that is the length of the movie in seconds.
See Also
Imports a movie asynchronously. Asynchronous downloads should be listed after synchronous ones and used for more complex sounds and images. For a description of the synchronous import method, see above.
The image portion of a movie has the same bounding box and placement as a static image such as a PNG or GIF.
Syntax
public static NumberBvr importMovie( URL url, ImageBvr[] img, SoundBvr[] snd, ImageBvr imgStandIn, SoundBvr sndStandIn, DXMEvent[] ev, NumberBvr[] progress, NumberBvr[] size );
Parameters
- url
- Fully qualified path of the movie to download. This parameter is of type java.net.URL.
- img
- Image portion of the movie (passed by reference).
- snd
- Sound portion of the movie (passed by reference).
- imgStandIn
- Image to use while the movie is still being downloaded. This parameter cannot be null, however, the image can be empty.
- sndStandIn
- Sound to use while the movie is still being downloaded. This parameter cannot be null, however, the sound can be silence.
- progress
- NumberBvr that goes from 0 to 1, tracking the progress of the download. For files downloaded via http, progress is reported as the percentage of the file that has been downloaded. Other protocols, the value may simply start at 0 and change to 1 once the download is complete. This argument can be null.
- size
- NumberBvr that is the size of the image, in bytes. The value begins at -1 and will change to the true size if it is available. This argument can be null.
Return Value
Returns the NumberBvr object that is the length of the movie in seconds.
See Also
Creates an image behavior by laying the image behavior i1 over the image behavior i2. The new image consists of all fully opaque points of i1, all points of i2 that are under fully transparent points in i1, and all partially opaque points of i1 modified such that the new point is a combination of the i1 point and the i2 point under it. The bounding box of a set of overlaid images is simply the union of the bounding boxes of the images themselves.
Syntax
public static ImageBvr overlay( ImageBvr i1, ImageBvr i2 );
Parameters
- i1 and i2
- ImageBvr objects.
Return Value
Returns the ImageBvr object.
Creates an image behavior by layering the ImageBvr objects. The bounding box of a set of overlaid images is simply the union of the bounding boxes of the images themselves.
Syntax
public static ImageBvr overlayArray( ImageBvr[] im );
Parameters
- im
- ImageBvr objects in the array.
Return Value
Returns the ImageBvr object.
Creates an image behavior that is a regular polygon with a radial fill. The image contains the specified colors at the origin and the exterior points, respectively. The gradient fill is determined by the fallOff argument and occurs in RGB space. Outside of the filled-in region, the image is transparent and unpickable. The bounding box is the box surrounding the points of the polygon.
Syntax
public static ImageBvr radialGradientPolygon( ColorBvr inner, ColorBvr outer, Point2Bvr[] points, NumberBvr fallOff );
Parameters
- inner
- ColorBvr object representing the color at the origin of the polygon.
- outer
- ColorBvr object representing the color at the vertices.
- points
- Point2Bvr object representing the array of points that determine the polygon's vertices.
- fallOff
- NumberBvr object used to control how rapidly one color transitions into another. A value of 1 is a linear transition. For 0 < power < 1 the transition occurs rapidly, while power > 1 means that the transition occurs more slowly. For example, if you are transitioning from red to blue, and power = 2, you will see a great deal of red in the gradient fill. On the other hand, if power = 0.5 (the inverse of 2), you will see very little red. If power = 0, you will see only blue. This parameter can also be of type double.
Return Value
Returns the ImageBvr object.
Creates an image behavior that is a regular, gradient polygon with the specified number of sides (there must be at least 3) and a radial fill. The image contains the specified colors at the origin and the exterior points, respectively. The gradient fill is determined by the fallOff argument and occurs in RGB space. Outside of the filled-in region, the image is transparent and unpickable. The bounding box is the box surrounding the points of the polygon.
Syntax
public static ImageBvr radialGradientRegularPoly( ColorBvr inner, ColorBvr outer, NumberBvr edges, NumberBvr fallOff );
Parameters
- inner
- ColorBvr object representing the color at the origin of the polygon.
- outer
- ColorBvr object representing the color at the vertices.
- edges
- NumberBvr object representing the number of edges the polygon has. This parameter can also be of type double.
- fallOff
- NumberBvr object used to control how rapidly one color transitions into another. A value of 1 is a linear transition. For 0 < power < 1 the transition occurs rapidly, while power > 1 means that the transition occurs more slowly. For example, if you are transitioning from red to blue, and power = 2, you will see a great deal of red in the gradient fill. On the other hand, if power = 0.5 (the inverse of 2), you will see very little red. If power = 0, you will see only blue. This parameter can also be of type double.
Return Value
Returns the ImageBvr object.
Creates an image behavior with a square radial fill. The image is a unit-sized square, centered at the origin, reaching from [-0.5, -0.5] to [0.5, 0.5]. The image contains the specified colors in the center and at the corners, respectively. The gradient fill is determined by the fallOff argument. The interpolation occurs in RGB space. Outside of the fill, the image is transparent and unpickable. The bounding box is a box from [-0.5, -0.5] to [0.5, 0.5].
Syntax
public static ImageBvr radialGradientSquare( ColorBvr inner, ColorBvr outer, NumberBvr fallOff );
Parameters
- inner
- ColorBvr at the center of the image.
- outer
- ColorBvr at the corners of the image.
- fallOff
- NumberBvr object used to control how rapidly one color transitions into another. A value of 1 is a linear transition. For 0 < power < 1 the transition occurs rapidly, while power > 1 means that the transition occurs more slowly. For example, if you are transitioning from red to blue, and power = 2, you will see a great deal of red in the gradient fill. On the other hand, if power = 0.5 (the inverse of 2), you will see very little red. If power = 0, you will see only blue. This parameter can also be of type double.
Return Value
Returns the ImageBvr object.
Creates an image behavior and applies the given color behavior to all points in the image. The bounding box of a solid-color image is the infinite bounding box.
Syntax
public static ImageBvr solidColorImage( ColorBvr col );
Parameters
- col
- ColorBvr object.
Return Value
Returns the ImageBvr object.
Constructs an ImageBvr object from a StringBvr object and a FontStyleBvr object.
Syntax
public static ImageBvr stringImage( StringBvr string, FontStyleBvr font );
Parameters
- string
- StringBvr object specifying the (potentially) animated text. This parameter can also be of type java.lang.String.
- font
- FontStyleBvr object specifying the font style (this can include the face, the size, the color, and the attributes).
Return Value
Returns the ImageBvr object.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.