本文整理汇总了Java中sun.awt.image.IntegerComponentRaster类的典型用法代码示例。如果您正苦于以下问题:Java IntegerComponentRaster类的具体用法?Java IntegerComponentRaster怎么用?Java IntegerComponentRaster使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IntegerComponentRaster类属于sun.awt.image包,在下文中一共展示了IntegerComponentRaster类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRaster
import sun.awt.image.IntegerComponentRaster; //导入依赖的package包/类
/**
* Return a Raster containing the colors generated for the graphics
* operation.
* @param x,y,w,h The area in device space for which colors are
* generated.
*/
public Raster getRaster(int x, int y, int w, int h) {
double rowrel = (x - x1) * dx + (y - y1) * dy;
Raster rast = saved;
if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
rast = getCachedRaster(model, w, h);
saved = rast;
}
IntegerComponentRaster irast = (IntegerComponentRaster) rast;
int off = irast.getDataOffset(0);
int adjust = irast.getScanlineStride() - w;
int[] pixels = irast.getDataStorage();
if (cyclic) {
cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
} else {
clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
}
irast.markDirty();
return rast;
}
示例2: getRaster
import sun.awt.image.IntegerComponentRaster; //导入依赖的package包/类
public synchronized Raster getRaster(int x, int y, int w, int h) {
WritableRaster t = savedTile;
if (t == null || w > t.getWidth() || h > t.getHeight()) {
t = getColorModel().createCompatibleWritableRaster(w, h);
IntegerComponentRaster icr = (IntegerComponentRaster) t;
Arrays.fill(icr.getDataStorage(), color);
// Note - markDirty is probably unnecessary since icr is brand new
icr.markDirty();
if (w <= 64 && h <= 64) {
savedTile = t;
}
}
return t;
}
示例3: createNativeImage
import sun.awt.image.IntegerComponentRaster; //导入依赖的package包/类
void createNativeImage(BufferedImage bimage) {
Raster raster = bimage.getRaster();
byte[] andMask = new byte[TRAY_ICON_MASK_SIZE];
int pixels[] = ((DataBufferInt)raster.getDataBuffer()).getData();
int npixels = pixels.length;
int ficW = raster.getWidth();
for (int i = 0; i < npixels; i++) {
int ibyte = i / 8;
int omask = 1 << (7 - (i % 8));
if ((pixels[i] & 0xff000000) == 0) {
// Transparent bit
if (ibyte < andMask.length) {
andMask[ibyte] |= omask;
}
}
}
if (raster instanceof IntegerComponentRaster) {
ficW = ((IntegerComponentRaster)raster).getScanlineStride();
}
setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
andMask, ficW, raster.getWidth(), raster.getHeight());
}
示例4: getRaster
import sun.awt.image.IntegerComponentRaster; //导入依赖的package包/类
/**
* Return a Raster containing the colors generated for the graphics
* operation.
* @param x,y,w,h The area in device space for which colors are
* generated.
*/
public Raster getRaster(int x, int y, int w, int h) {
double rowrel = (x - x1) * dx + (y - y1) * dy;
Raster rast = saved;
if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
rast = getCachedRaster(model, w, h);
saved = rast;
}
IntegerComponentRaster irast = (IntegerComponentRaster) rast;
int off = irast.getDataOffset(0);
int adjust = irast.getScanlineStride() - w;
int[] pixels = irast.getDataStorage();
if (cyclic) {
cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
} else {
clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
}
return rast;
}
示例5: getRaster
import sun.awt.image.IntegerComponentRaster; //导入依赖的package包/类
public Raster getRaster(int x, int y, int w, int h) {
double rowrel = (x - myX1) * myDx + (y - myY1) * myDy;
Raster rast = saved;
if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
rast = getCachedRaster(model, w, h);
saved = rast;
}
IntegerComponentRaster irast = (IntegerComponentRaster)rast;
int off = irast.getDataOffset(0);
int adjust = irast.getScanlineStride() - w;
int[] pixels = irast.getDataStorage();
clipFillRaster(pixels, off, adjust, w, h, rowrel, myDx, myDy);
return rast;
}