-
drawImage
public abstract boolean drawImageabstract boolean drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color bgcolor,
ImageObserver observer)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. Transparent pixels are drawn in the specified background color. This operation is equivalent to filling a rectangle of the width and height of the specified image with the given color and then drawing the image on top of it, but possibly more efficient.
This method returns immediately in all cases, even if the image area to be drawn has not yet been scaled, dithered, and converted for the current output device. If the current output representation is not yet complete then drawImage returns false . As more of the image becomes available, the process that loads the image notifies the specified image observer.
This method always uses the unscaled version of the image to render the scaled rectangle and performs the required scaling on the fly. It does not use a cached, scaled version of the image for this operation. Scaling of the image from source to destination is performed such that the first coordinate of the source rectangle is mapped to the first coordinate of the destination rectangle, and the second source coordinate is mapped to the second destination coordinate. The subimage is scaled and flipped as needed to preserve those mappings.
-
Parameters:
-
img - the specified image to be drawn. This method does nothing if img is null.
-
dx1 - the x coordinate of the first corner of the destination rectangle.
-
dy1 - the y coordinate of the first corner of the destination rectangle.
-
dx2 - the x coordinate of the second corner of the destination rectangle.
-
dy2 - the y coordinate of the second corner of the destination rectangle.
-
sx1 - the x coordinate of the first corner of the source rectangle.
-
sy1 - the y coordinate of the first corner of the source rectangle.
-
sx2 - the x coordinate of the second corner of the source rectangle.
-
sy2 - the y coordinate of the second corner of the source rectangle.
-
bgcolor - the background color to paint under the non-opaque portions of the image.
-
observer - object to be notified as more of the image is scaled and converted.
-
Returns:
-
false if the image pixels are still changing; true otherwise.
-
Since:
-
JDK11.1
-
See Also:
-
Image , ImageObserver , ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)
|
-
drawImage
public abstract boolean drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color bgcolor,
ImageObserver observer)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. Transparent pixels are drawn in the specified background color. This operation is equivalent to filling a rectangle of the width and height of the specified image with the given color and then drawing the image on top of it, but possibly more efficient.
This method returns immediately in all cases, even if the image area to be drawn has not yet been scaled, dithered, and converted for the current output device. If the current output representation is not yet complete then drawImage returns false . As more of the image becomes available, the process that loads the image notifies the specified image observer.
This method always uses the unscaled version of the image to render the scaled rectangle and performs the required scaling on the fly. It does not use a cached, scaled version of the image for this operation. Scaling of the image from source to destination is performed such that the first coordinate of the source rectangle is mapped to the first coordinate of the destination rectangle, and the second source coordinate is mapped to the second destination coordinate. The subimage is scaled and flipped as needed to preserve those mappings.
-
Parameters:
-
img - the specified image to be drawn. This method does nothing if img is null.
-
dx1 - the x coordinate of the first corner of the destination rectangle.
-
dy1 - the y coordinate of the first corner of the destination rectangle.
-
dx2 - the x coordinate of the second corner of the destination rectangle.
-
dy2 - the y coordinate of the second corner of the destination rectangle.
-
sx1 - the x coordinate of the first corner of the source rectangle.
-
sy1 - the y coordinate of the first corner of the source rectangle.
-
sx2 - the x coordinate of the second corner of the source rectangle.
-
sy2 - the y coordinate of the second corner of the source rectangle.
-
bgcolor - the background color to paint under the non-opaque portions of the image.
-
observer - object to be notified as more of the image is scaled and converted.
-
Returns:
-
false if the image pixels are still changing; true otherwise.
-
Since:
- JDK1.1
-
See Also:
-
Image , ImageObserver , ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)
|
-
drawImage
public abstract boolean drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color bgcolor,
ImageObserver observer)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. Transparent pixels are drawn in the specified background color. This operation is equivalent to filling a rectangle of the width and height of the specified image with the given color and then drawing the image on top of it, but possibly more efficient.
This method returns immediately in all cases, even if the image area to be drawn has not yet been scaled, dithered, and converted for the current output device. If the current output representation is not yet complete then drawImage returns false . As more of the image becomes available, the process that loads the image notifies the specified image observer.
This method always uses the unscaled version of the image to render the scaled rectangle and performs the required scaling on the fly. It does not use a cached, scaled version of the image for this operation. Scaling of the image from source to destination is performed such that the first coordinate of the source rectangle is mapped to the first coordinate of the destination rectangle, and the second source coordinate is mapped to the second destination coordinate. The subimage is scaled and flipped as needed to preserve those mappings.
-
Parameters:
-
img - the specified image to be drawn. This method does nothing if img is null.
-
dx1 - the x coordinate of the first corner of the destination rectangle.
-
dy1 - the y coordinate of the first corner of the destination rectangle.
-
dx2 - the x coordinate of the second corner of the destination rectangle.
-
dy2 - the y coordinate of the second corner of the destination rectangle.
-
sx1 - the x coordinate of the first corner of the source rectangle.
-
sy1 - the y coordinate of the first corner of the source rectangle.
-
sx2 - the x coordinate of the second corner of the source rectangle.
-
sy2 - the y coordinate of the second corner of the source rectangle.
-
bgcolor - the background color to paint under the non-opaque portions of the image.
-
observer - object to be notified as more of the image is scaled and converted.
-
Returns:
-
false if the image pixels are still changing; true otherwise.
-
Since:
- 1.1
-
See Also:
-
Image , ImageObserver , ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)
|
|