下面列出了怎么用sun.awt.image.ImageRepresentation的API类实例代码及写法,或者点击链接到github查看源代码。
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);
}
}
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);
}
}
public boolean scaleImage(SunGraphics2D sg, Image img,
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
Color bgColor,
ImageObserver observer) {
if (!(img instanceof ToolkitImage)) {
return scaleImage(sg, img, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, bgColor);
} else {
ToolkitImage sunimg = (ToolkitImage)img;
if (!imageReady(sunimg, observer)) {
return false;
}
ImageRepresentation ir = sunimg.getImageRep();
return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, bgColor, observer);
}
}
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();
}
}
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();
}
}
public boolean scaleImage(SunGraphics2D sg, Image img,
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
Color bgColor,
ImageObserver observer) {
if (!(img instanceof ToolkitImage)) {
return scaleImage(sg, img, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, bgColor);
} else {
ToolkitImage sunimg = (ToolkitImage)img;
if (!imageReady(sunimg, observer)) {
return false;
}
ImageRepresentation ir = sunimg.getImageRep();
return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, bgColor, observer);
}
}
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);
}
}
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();
}
}
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);
}
}
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);
}
}
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;
}
}
}
}
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();
}
}
public boolean scaleImage(SunGraphics2D sg, Image img,
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
Color bgColor,
ImageObserver observer) {
if (!(img instanceof ToolkitImage)) {
return scaleImage(sg, img, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, bgColor);
} else {
ToolkitImage sunimg = (ToolkitImage)img;
if (!imageReady(sunimg, observer)) {
return false;
}
ImageRepresentation ir = sunimg.getImageRep();
return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, bgColor, observer);
}
}
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;
}
}
}
}
public boolean scaleImage(SunGraphics2D sg, Image img,
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
Color bgColor,
ImageObserver observer) {
if (!(img instanceof ToolkitImage)) {
return scaleImage(sg, img, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, bgColor);
} else {
ToolkitImage sunimg = (ToolkitImage)img;
if (!imageReady(sunimg, observer)) {
return false;
}
ImageRepresentation ir = sunimg.getImageRep();
return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, bgColor, observer);
}
}
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();
}
}
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;
}
}
}
}
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;
}
}
}
}
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();
}
}
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);
}
}
public boolean scaleImage(SunGraphics2D sg, Image img,
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
Color bgColor,
ImageObserver observer) {
if (!(img instanceof ToolkitImage)) {
return scaleImage(sg, img, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, bgColor);
} else {
ToolkitImage sunimg = (ToolkitImage)img;
if (!imageReady(sunimg, observer)) {
return false;
}
ImageRepresentation ir = sunimg.getImageRep();
return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, bgColor, observer);
}
}
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);
}
}
public boolean scaleImage(SunGraphics2D sg, Image img,
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
Color bgColor,
ImageObserver observer) {
if (!(img instanceof ToolkitImage)) {
return scaleImage(sg, img, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, bgColor);
} else {
ToolkitImage sunimg = (ToolkitImage)img;
if (!imageReady(sunimg, observer)) {
return false;
}
ImageRepresentation ir = sunimg.getImageRep();
return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, bgColor, observer);
}
}
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;
}
}
}
}
public boolean transformImage(SunGraphics2D sg, Image img,
AffineTransform atfm,
ImageObserver observer) {
if (!(img instanceof ToolkitImage)) {
transformImage(sg, img, 0, 0, atfm, sg.interpolationType);
return true;
} else {
ToolkitImage sunimg = (ToolkitImage)img;
if (!imageReady(sunimg, observer)) {
return false;
}
ImageRepresentation ir = sunimg.getImageRep();
return ir.drawToBufImage(sg, sunimg, atfm, observer);
}
}
public boolean copyImage(SunGraphics2D sg, Image img,
int x, int y,
Color bgColor,
ImageObserver observer) {
if (!(img instanceof ToolkitImage)) {
return copyImage(sg, img, x, y, bgColor);
} else {
ToolkitImage sunimg = (ToolkitImage)img;
if (!imageReady(sunimg, observer)) {
return false;
}
ImageRepresentation ir = sunimg.getImageRep();
return ir.drawToBufImage(sg, sunimg, x, y, bgColor, observer);
}
}
public boolean transformImage(SunGraphics2D sg, Image img,
AffineTransform atfm,
ImageObserver observer) {
if (!(img instanceof ToolkitImage)) {
transformImage(sg, img, 0, 0, atfm, sg.interpolationType);
return true;
} else {
ToolkitImage sunimg = (ToolkitImage)img;
if (!imageReady(sunimg, observer)) {
return false;
}
ImageRepresentation ir = sunimg.getImageRep();
return ir.drawToBufImage(sg, sunimg, atfm, observer);
}
}
public boolean transformImage(SunGraphics2D sg, Image img,
AffineTransform atfm,
ImageObserver observer) {
if (!(img instanceof ToolkitImage)) {
transformImage(sg, img, 0, 0, atfm, sg.interpolationType);
return true;
} else {
ToolkitImage sunimg = (ToolkitImage)img;
if (!imageReady(sunimg, observer)) {
return false;
}
ImageRepresentation ir = sunimg.getImageRep();
return ir.drawToBufImage(sg, sunimg, atfm, observer);
}
}
private synchronized void addWatcher(ImageObserver iw, boolean load) {
if ((availinfo & ImageObserver.ERROR) != 0) {
if (iw != null) {
iw.imageUpdate(this, ImageObserver.ERROR|ImageObserver.ABORT,
-1, -1, -1, -1);
}
return;
}
ImageRepresentation ir = getImageRep();
ir.addWatcher(iw);
if (load) {
ir.startProduction();
}
}
public boolean copyImage(SunGraphics2D sg, Image img,
int x, int y,
Color bgColor,
ImageObserver observer) {
if (!(img instanceof ToolkitImage)) {
return copyImage(sg, img, x, y, bgColor);
} else {
ToolkitImage sunimg = (ToolkitImage)img;
if (!imageReady(sunimg, observer)) {
return false;
}
ImageRepresentation ir = sunimg.getImageRep();
return ir.drawToBufImage(sg, sunimg, x, y, bgColor, observer);
}
}