本文整理匯總了Java中java.awt.Color.getTransparency方法的典型用法代碼示例。如果您正苦於以下問題:Java Color.getTransparency方法的具體用法?Java Color.getTransparency怎麽用?Java Color.getTransparency使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.Color
的用法示例。
在下文中一共展示了Color.getTransparency方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isSupportedOperation
import java.awt.Color; //導入方法依賴的package包/類
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}