/**
* Draws a BufferedImage that is filtered with a BufferedImageOp.
* The rendering attributes applied include the clip, transform
* and composite attributes. This is equivalent to:
* <pre>
* img1 = op.filter(img, null);
* drawImage(img1, new AffineTransform(1f,0f,0f,1f,x,y), null);
* </pre>
* @param op The filter to be applied to the image before drawing.
* @param img The BufferedImage to be drawn.
* This method does nothing if <code>img</code> is null.
* @param x,y The location in user space where the image should be drawn.
* @see #transform
* @see #setTransform
* @see #setComposite
* @see #clip
* @see #setClip
*/
public void drawImage(BufferedImage img,
BufferedImageOp op,
int x,
int y) {
if (img == null) {
return;
}
int srcWidth = img.getWidth(null);
int srcHeight = img.getHeight(null);
if (op != null) {
img = op.filter(img, null);
}
if (srcWidth <= 0 || srcHeight <= 0) {
return;
} else {
AffineTransform xform = new AffineTransform(1f,0f,0f,1f,x,y);
drawImageToPlatform(img, xform, null,
0, 0, srcWidth, srcHeight, false);
}
}
PathGraphics.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:jdk8u-jdk
作者:
评论列表
文章目录