Search in sources :

Example 1 with MaskFilter

use of android.graphics.MaskFilter in project AndroidStudy by tinggengyan.

the class HandWritingView method getMaskFilter.

/**
 * 功能:设置画笔风格
 */
private MaskFilter getMaskFilter(int mPaintType) {
    MaskFilter maskFilter = null;
    switch(mPaintType) {
        case // 铅笔模糊风格
        BLUR:
            maskFilter = new BlurMaskFilter(8, BlurMaskFilter.Blur.NORMAL);
            break;
        case // 毛笔浮雕风格
        EMBOSS:
            maskFilter = new EmbossMaskFilter(new float[] { 1, 1, 1 }, 0.4f, 6, 3.5f);
            break;
        case // 透明水彩风格
        TS_PEN:
            maskFilter = null;
            paint.setAlpha(50);
            break;
        default:
            maskFilter = null;
            break;
    }
    paint.setMaskFilter(maskFilter);
    return maskFilter;
}
Also used : MaskFilter(android.graphics.MaskFilter) EmbossMaskFilter(android.graphics.EmbossMaskFilter) BlurMaskFilter(android.graphics.BlurMaskFilter) BlurMaskFilter(android.graphics.BlurMaskFilter) EmbossMaskFilter(android.graphics.EmbossMaskFilter)

Example 2 with MaskFilter

use of android.graphics.MaskFilter in project assertj-android by square.

the class AbstractPaintAssert method hasMaskFilter.

public S hasMaskFilter(MaskFilter filter) {
    isNotNull();
    MaskFilter actualFilter = actual.getMaskFilter();
    // 
    assertThat(actualFilter).overridingErrorMessage("Expected mask filter <%s> but was <%s>.", filter, // 
    actualFilter).isSameAs(filter);
    return myself;
}
Also used : MaskFilter(android.graphics.MaskFilter)

Aggregations

MaskFilter (android.graphics.MaskFilter)2 BlurMaskFilter (android.graphics.BlurMaskFilter)1 EmbossMaskFilter (android.graphics.EmbossMaskFilter)1