當前位置: 首頁>>代碼示例>>Java>>正文


Java AlphaComposite.getAlpha方法代碼示例

本文整理匯總了Java中java.awt.AlphaComposite.getAlpha方法的典型用法代碼示例。如果您正苦於以下問題:Java AlphaComposite.getAlpha方法的具體用法?Java AlphaComposite.getAlpha怎麽用?Java AlphaComposite.getAlpha使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.AlphaComposite的用法示例。


在下文中一共展示了AlphaComposite.getAlpha方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: checkAlpha

import java.awt.AlphaComposite; //導入方法依賴的package包/類
/**
 * Record information about drawing done
 * with the supplied <code>Composite</code>.
 */
private void checkAlpha(Composite composite) {

    if (composite instanceof AlphaComposite) {
        AlphaComposite alphaComposite = (AlphaComposite) composite;
        float alpha = alphaComposite.getAlpha();
        int rule = alphaComposite.getRule();

        if (alpha != 1.0
                || (rule != AlphaComposite.SRC
                    && rule != AlphaComposite.SRC_OVER)) {

            mHasCompositing = true;
        }

    } else {
        mHasCompositing = true;
    }

}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:24,代碼來源:PeekMetrics.java

示例2: checkAlpha

import java.awt.AlphaComposite; //導入方法依賴的package包/類
/**
 * Record information about drawing done
 * with the supplied {@code Composite}.
 */
private void checkAlpha(Composite composite) {

    if (composite instanceof AlphaComposite) {
        AlphaComposite alphaComposite = (AlphaComposite) composite;
        float alpha = alphaComposite.getAlpha();
        int rule = alphaComposite.getRule();

        if (alpha != 1.0
                || (rule != AlphaComposite.SRC
                    && rule != AlphaComposite.SRC_OVER)) {

            mHasCompositing = true;
        }

    } else {
        mHasCompositing = true;
    }

}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:24,代碼來源:PeekMetrics.java

示例3: forAlphaComposite

import java.awt.AlphaComposite; //導入方法依賴的package包/類
/**
 * Return a CompositeType object for the specified AlphaComposite
 * rule.
 */
public static CompositeType forAlphaComposite(AlphaComposite ac) {
    switch (ac.getRule()) {
    case AlphaComposite.CLEAR:
        return Clear;
    case AlphaComposite.SRC:
        if (ac.getAlpha() >= 1.0f) {
            return SrcNoEa;
        } else {
            return Src;
        }
    case AlphaComposite.DST:
        return Dst;
    case AlphaComposite.SRC_OVER:
        if (ac.getAlpha() >= 1.0f) {
            return SrcOverNoEa;
        } else {
            return SrcOver;
        }
    case AlphaComposite.DST_OVER:
        return DstOver;
    case AlphaComposite.SRC_IN:
        return SrcIn;
    case AlphaComposite.DST_IN:
        return DstIn;
    case AlphaComposite.SRC_OUT:
        return SrcOut;
    case AlphaComposite.DST_OUT:
        return DstOut;
    case AlphaComposite.SRC_ATOP:
        return SrcAtop;
    case AlphaComposite.DST_ATOP:
        return DstAtop;
    case AlphaComposite.XOR:
        return AlphaXor;
    default:
        throw new InternalError("Unrecognized alpha rule");
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:43,代碼來源:CompositeType.java

示例4: canHandleComposite

import java.awt.AlphaComposite; //導入方法依賴的package包/類
private boolean canHandleComposite(Composite c) {
    if (c instanceof AlphaComposite) {
        AlphaComposite ac = (AlphaComposite)c;

        return ac.getRule() == AlphaComposite.SRC_OVER && ac.getAlpha() >= 1f;
    }
    return false;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:9,代碼來源:OGLSurfaceData.java


注:本文中的java.awt.AlphaComposite.getAlpha方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。