(x_src, y_src, width, height)
to a destination area, whose anchor point identified by anchor is located at (x_dest, y_dest)
. The effect must be that the destination area contains an exact copy of the contents of the source area immediately prior to the invocation of this method. This result must occur even if the source and destination areas overlap. The points (x_src, y_src)
and (x_dest, y_dest)
are both specified relative to the coordinate system of the Graphics
object. It is illegal for the source region to extend beyond the bounds of the graphic object. This requires that:
|
where tx
and ty
represent the X and Y coordinates of the translated origin of this graphics object, as returned by getTranslateX()
and getTranslateY()
, respectively.
However, it is legal for the destination area to extend beyond the bounds of the Graphics
object. Pixels outside of the bounds of the Graphics
object will not be drawn.
The copyArea
method is allowed on all Graphics
objects except those whose destination is the actual display device. This restriction is necessary because allowing a copyArea
method on the display would adversely impact certain techniques for implementing double-buffering.
Like other graphics operations, the copyArea
method uses the Source Over Destination rule for combining pixels. However, since it is defined only for mutable images, which can contain only fully opaque pixels, this is effectively the same as pixel replacement.
Graphics
object is the display device
@throws IllegalArgumentException if the region to be copied exceedsthe bounds of the source image
|
|
|
|