本文整理汇总了Java中java.awt.image.IndexColorModel.getTransparentPixel方法的典型用法代码示例。如果您正苦于以下问题:Java IndexColorModel.getTransparentPixel方法的具体用法?Java IndexColorModel.getTransparentPixel怎么用?Java IndexColorModel.getTransparentPixel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.image.IndexColorModel
的用法示例。
在下文中一共展示了IndexColorModel.getTransparentPixel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setColorModel
import java.awt.image.IndexColorModel; //导入方法依赖的package包/类
public void setColorModel(ColorModel model) {
if (src != null) {
src.checkSecurity(null, false);
}
srcModel = model;
// Check to see if model is INT_RGB
if (model instanceof IndexColorModel) {
if (model.getTransparency() == model.TRANSLUCENT) {
// REMIND:
// Probably need to composite anyway so force ARGB
cmodel = ColorModel.getRGBdefault();
srcLUT = null;
}
else {
IndexColorModel icm = (IndexColorModel) model;
numSrcLUT = icm.getMapSize();
srcLUT = new int[Math.max(numSrcLUT, 256)];
icm.getRGBs(srcLUT);
srcLUTtransIndex = icm.getTransparentPixel();
cmodel = model;
}
}
else {
if (cmodel == null) {
cmodel = model;
srcLUT = null;
}
else if (model instanceof DirectColorModel) {
// If it is INT_RGB or INT_ARGB, use the model
DirectColorModel dcm = (DirectColorModel) model;
if ((dcm.getRedMask() == 0xff0000) &&
(dcm.getGreenMask() == 0xff00) &&
(dcm.getBlueMask() == 0x00ff)) {
cmodel = model;
srcLUT = null;
}
}
}
isSameCM = (cmodel == model);
}
示例2: setColorModel
import java.awt.image.IndexColorModel; //导入方法依赖的package包/类
public void setColorModel(ColorModel model) {
if (src != null) {
src.checkSecurity(null, false);
}
srcModel = model;
// Check to see if model is INT_RGB
if (model instanceof IndexColorModel) {
if (model.getTransparency() == Transparency.TRANSLUCENT) {
// REMIND:
// Probably need to composite anyway so force ARGB
cmodel = ColorModel.getRGBdefault();
srcLUT = null;
}
else {
IndexColorModel icm = (IndexColorModel) model;
numSrcLUT = icm.getMapSize();
srcLUT = new int[Math.max(numSrcLUT, 256)];
icm.getRGBs(srcLUT);
srcLUTtransIndex = icm.getTransparentPixel();
cmodel = model;
}
}
else {
if (cmodel == null) {
cmodel = model;
srcLUT = null;
}
else if (model instanceof DirectColorModel) {
// If it is INT_RGB or INT_ARGB, use the model
DirectColorModel dcm = (DirectColorModel) model;
if ((dcm.getRedMask() == 0xff0000) &&
(dcm.getGreenMask() == 0xff00) &&
(dcm.getBlueMask() == 0x00ff)) {
cmodel = model;
srcLUT = null;
}
}
}
isSameCM = (cmodel == model);
}