borland Packages  Class Hierarchy  jbcl.util Package  Index 

ImageTexture class

java.lang.Object
   +----borland.jbcl.util.ImageTexture

About the ImageTexture class

Properties  Methods  

Implements Serializable

ImageTexture is a utility class that copies the pixels of a source image onto a larger destination surface, repeating the source image over and over to give the appearance of a texture to the destination surface. The class calculates the relative position of the origin between the source image and the destination surface and blits the Image. This allows the methods to be called multiple times passing overlapping or non-contiguous rectangles, and the images will always line up to form a seamless texture.


ImageTexture properties

*Read-only properties **Write-only properties

Properties implemented in java.lang.Object

ImageTexture methods

Methods implemented in this class

Methods implemented in java.lang.Object


ImageTexture methods

texture(java.awt.Image, int, int, java.awt.Graphics, int, int, int, int)

  public static void texture(java.awt.Image src, int sw, int sh, java.awt.Graphics dest, int x, int y, int w, int h)
This method tiles the source image specified onto the target surface with tiles of the specified size, repeating the image to fill in the specified rectangle.

Values less or equal to zero for the tile size result in that dimension of the image to remain unscaled (100%). This method uses the (0,0) origin to line up all the image blits so that overlapping or noncontiguous calls to this method produces a seamless texture.

Parameters:

src
The source image to tile.
sw
The desired scaled width of the tiles. Values equal to or less than 0 result in an unscaled (100%) dimension.
sh
The desired scaled height of the tiles. Values equal to or less than 0 result in an unscaled (100%) dimension.
dest
The destination Graphics context.
x
The x coordinate of the target rectangle.
y
The y coordinate of the target rectangle.
w
The width of the target rectangle.
h
The height of the target rectangle.

texture(java.awt.Image, int, int, java.awt.Graphics, int, int, int, int, int, int)

  public static void texture(java.awt.Image src, int sw, int sh, java.awt.Graphics dest, int ox, int oy, int x, int y, int w, int h)
All the texture() methods call this one method.

texture() tiles the source image onto the target surface with tiles of the specified size, repeating the image over and over to fill in the specified rectangle. Values less or equal to zero for the tile size result in that dimension of the image to remain unscaled (100%). This method uses the passed (ox,oy) origin to line up all the image blits so that overlapping or noncontiguous calls to this method produces a seamless texture.

Parameters:

src
The source image to tile.
sw
The desired scaled width of the tiles. Values less than or equal to 0 result in an unscaled (100%) dimension.
sh
The desired scaled height of the tiles. Values less than or equal to 0 result in an unscaled (100%) dimension.
dest
The destination Graphics context.
ox
The x coordinate of the texture origin point.
oy
The y coordinate of the texture origin point.
x
The x coordinate of the target rectangle.
y
The y coordinate of the target rectangle.
w
The width of the target rectangle.
h
The height of the target rectangle.

texture(java.awt.Image, java.awt.Graphics, int, int, int, int)

  public static void texture(java.awt.Image src, java.awt.Graphics dest, int x, int y, int w, int h)
This method tiles the source image onto the target surface at 100% scale, repeating the image over and over to fill in the specified rectangle (x,y,w,h). This method uses the (0,0) origin to line up all the image blits so that overlapping or non-contiguous calls to this method produces a seamless texture.

Parameters:

src
The source image to tile.
dest
The destination Graphics context.
x
The x coordinate of the target rectangle.
y
The y coordinate of the target rectangle.
w
The width of the target rectangle.
h
The height of the target rectangle.

texture(java.awt.Image, java.awt.Graphics, int, int, int, int, int, int)

  public static void texture(java.awt.Image src, java.awt.Graphics dest, int ox, int oy, int x, int y, int w, int h)
This method tiles the source image onto the target surface at 100% scale, repeating the image over and over to fill in the specified rectangle (x,y,w,h). This method uses the passed (ox,oy) origin to line up all the image blits so that overlapping or non-contiguous calls to this method will produce a seamless texture.

Parameters:

src
The source image to tile.
dest
The destination Graphics context.
ox
The x coordinate of the texture origin point.
oy
The y coordinate of the texture origin point.
x
The x coordinate of the target rectangle.
y
The y coordinate of the target rectangle.
w
The width of the target rectangle.
h
The height of the target rectangle.