本文整理汇总了Java中sun.awt.image.ImageRepresentation类的典型用法代码示例。如果您正苦于以下问题:Java ImageRepresentation类的具体用法?Java ImageRepresentation怎么用?Java ImageRepresentation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImageRepresentation类属于sun.awt.image包,在下文中一共展示了ImageRepresentation类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: copyImage
import sun.awt.image.ImageRepresentation; //导入依赖的package包/类
public boolean copyImage(SunGraphics2D sg, Image img,
int dx, int dy, int sx, int sy, int w, int h,
Color bgColor,
ImageObserver observer) {
if (!(img instanceof ToolkitImage)) {
return copyImage(sg, img, dx, dy, sx, sy, w, h, bgColor);
} else {
ToolkitImage sunimg = (ToolkitImage)img;
if (!imageReady(sunimg, observer)) {
return false;
}
ImageRepresentation ir = sunimg.getImageRep();
return ir.drawToBufImage(sg, sunimg,
dx, dy, (dx + w), (dy + h),
sx, sy, (sx + w), (sy + h),
bgColor, observer);
}
}
示例2: scaleImage
import sun.awt.image.ImageRepresentation; //导入依赖的package包/类
public boolean scaleImage(SunGraphics2D sg, Image img,
int x, int y,
int width, int height,
Color bgColor,
ImageObserver observer) {
if (!(img instanceof ToolkitImage)) {
return scaleImage(sg, img, x, y, width, height, bgColor);
} else {
ToolkitImage sunimg = (ToolkitImage)img;
if (!imageReady(sunimg, observer)) {
return false;
}
ImageRepresentation ir = sunimg.getImageRep();
return ir.drawToBufImage(sg, sunimg, x, y, width, height, bgColor,
observer);
}
}
示例3: reconstruct
import sun.awt.image.ImageRepresentation; //导入依赖的package包/类
private synchronized void reconstruct(int flags) {
if ((flags & ~availinfo) != 0) {
if ((availinfo & ImageObserver.ERROR) != 0) {
return;
}
ImageRepresentation ir = getImageRep();
ir.startProduction();
while ((flags & ~availinfo) != 0) {
try {
wait();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return;
}
if ((availinfo & ImageObserver.ERROR) != 0) {
return;
}
}
}
}
示例4: flush
import sun.awt.image.ImageRepresentation; //导入依赖的package包/类
public void flush() {
if (src != null) {
src.checkSecurity(null, false);
}
ImageRepresentation ir;
synchronized (this) {
availinfo &= ~ImageObserver.ERROR;
ir = imagerep;
imagerep = null;
}
if (ir != null) {
ir.abort();
}
if (src != null) {
src.flush();
}
}
示例5: prepareImage
import sun.awt.image.ImageRepresentation; //导入依赖的package包/类
@Override
public boolean prepareImage(Image img, int w, int h, ImageObserver o) {
if (w == 0 || h == 0) {
return true;
}
// Must be a ToolkitImage
if (!(img instanceof ToolkitImage)) {
return true;
}
ToolkitImage tkimg = (ToolkitImage)img;
if (tkimg.hasError()) {
if (o != null) {
o.imageUpdate(img, ImageObserver.ERROR|ImageObserver.ABORT,
-1, -1, -1, -1);
}
return false;
}
ImageRepresentation ir = tkimg.getImageRep();
return ir.prepare(o) & prepareResolutionVariant(img, w, h, o);
}