Android BlurMaskFilter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android BlurMaskFilter class.

This code example shows how to use the following methods:
This code example shows how to use the following methods:
		// Create background 
		final Bitmap alpha = src.extractAlpha();
		paint.setColor(color);
		canvas.drawBitmap(alpha, 0, 0, paint);
		// Create outer blur 
		final BlurMaskFilter filter = new BlurMaskFilter(radius, BlurMaskFilter.Blur.OUTER);
		paint.setMaskFilter(filter);
		canvas.drawBitmap(alpha, 0, 0, paint);
		return dest;
	} 
} 
7
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
        mShadowPaint.setStyle(Style.FILL);
        setWillNotDraw(false);
        mShadowBitmap = Bitmap.createBitmap(sShadowRect.width(),
                sShadowRect.height(), Bitmap.Config.ARGB_8888);
        Canvas c = new Canvas(mShadowBitmap);
        mShadowPaint.setMaskFilter(new BlurMaskFilter(BLUR_RADIUS, Blur.NORMAL));
        c.translate(BLUR_RADIUS, BLUR_RADIUS);
        c.drawRoundRect(sShadowRectF, sShadowRectF.width() / 40,
                sShadowRectF.height() / 40, mShadowPaint);
    } 
     
    /** 
     * The "depth" factor determines the offset distance and opacity of the shadow (shadows that 
     * are further away from the source are offset greater and are more translucent). 
     * @param depth 
     */ 
    public void setShadowDepth(float depth) {
        if (depth != mShadowDepth) {
            mShadowDepth = depth;
            mShadowPaint.setAlpha((int) (100 + 150 * (1 - mShadowDepth)));
6
CodeRank
This code example shows how to use the following methods:
 
        sExtraThickOuterBlurMaskFilter = new BlurMaskFilter(scale * 12.0f, BlurMaskFilter.Blur.OUTER);
        sThickOuterBlurMaskFilter = new BlurMaskFilter(scale * 6.0f, BlurMaskFilter.Blur.OUTER);
        sMediumOuterBlurMaskFilter = new BlurMaskFilter(scale * 2.0f, BlurMaskFilter.Blur.OUTER);
        sThinOuterBlurMaskFilter = new BlurMaskFilter(scale * 1.0f, BlurMaskFilter.Blur.OUTER);
        sExtraThickInnerBlurMaskFilter = new BlurMaskFilter(scale * 6.0f, BlurMaskFilter.Blur.NORMAL);
        sThickInnerBlurMaskFilter = new BlurMaskFilter(scale * 4.0f, BlurMaskFilter.Blur.NORMAL);
        sMediumInnerBlurMaskFilter = new BlurMaskFilter(scale * 2.0f, BlurMaskFilter.Blur.NORMAL);
    } 
 
    HolographicOutlineHelper() { 
        mHolographicPaint.setFilterBitmap(true);
        mHolographicPaint.setAntiAlias(true);
        mBlurPaint.setFilterBitmap(true);
        mBlurPaint.setAntiAlias(true);
        mErasePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
        mErasePaint.setFilterBitmap(true);
        mErasePaint.setAntiAlias(true);
    } 
 
6
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
        sExtraThickOuterBlurMaskFilter = new BlurMaskFilter(scale * 12.0f, BlurMaskFilter.Blur.OUTER);
        sThickOuterBlurMaskFilter = new BlurMaskFilter(scale * 6.0f, BlurMaskFilter.Blur.OUTER);
        sMediumOuterBlurMaskFilter = new BlurMaskFilter(scale * 2.0f, BlurMaskFilter.Blur.OUTER);
        sThinOuterBlurMaskFilter = new BlurMaskFilter(scale * 1.0f, BlurMaskFilter.Blur.OUTER);
        sExtraThickInnerBlurMaskFilter = new BlurMaskFilter(scale * 6.0f, BlurMaskFilter.Blur.NORMAL);
        sThickInnerBlurMaskFilter = new BlurMaskFilter(scale * 4.0f, BlurMaskFilter.Blur.NORMAL);
        sMediumInnerBlurMaskFilter = new BlurMaskFilter(scale * 2.0f, BlurMaskFilter.Blur.NORMAL);
    } 
 
    private static final MaskFilter sCoarseClipTable = TableMaskFilter.CreateClipTable(0, 200);
 
    private int[] mTempOffset = new int[2];
 
    HolographicOutlineHelper() { 
        mHolographicPaint.setFilterBitmap(true);
        mHolographicPaint.setAntiAlias(true);
        mBlurPaint.setFilterBitmap(true);
        mBlurPaint.setAntiAlias(true);
        mErasePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
        mErasePaint.setFilterBitmap(true);
6
CodeRank
This code example shows how to use the following methods:
	 * @param value 
	 *           the new blur 
	 */ 
	public void setBlur( int value ) {
		if ( value > 0 ) {
			mPaint.setMaskFilter( new BlurMaskFilter( value, Blur.NORMAL ) );
		} else { 
			mPaint.setMaskFilter( null );
		} 
	} 
 
	/* 
	 * (non-Javadoc) 
	 *  
	 * @see android.graphics.drawable.Drawable#draw(android.graphics.Canvas) 
	 */ 
	@Override 
	public void draw( final Canvas canvas ) {
		final RectF rect = new RectF( getBounds() );
		canvas.drawCircle( rect.centerX(), rect.centerY(), mRadius, mPaint );
6
CodeRank
This code example shows how to use the following methods:
	 *           the blur_size 
	 */ 
	public void update( float radius, int blur_size ) {
		mOriginalRadius = radius;
		if ( blur_size > 0 )
			mPaint.setMaskFilter( new BlurMaskFilter( blur_size, Blur.NORMAL ) );
		else 
			mPaint.setMaskFilter( null );
		invalidateSelf(); 
	} 
 
	/* 
	 * (non-Javadoc) 
	 *  
	 * @see android.graphics.drawable.Drawable#draw(android.graphics.Canvas) 
	 */ 
	@Override 
	public void draw( Canvas canvas ) {
		canvas.drawCircle( centerX, centerY + mShadowOffset, mRadius, mShadowPaint );
		canvas.drawCircle( centerX, centerY, mRadius, mPaint );
6
CodeRank
This code example shows how to use the following methods:
        final float density = metrics.density;
 
        sIconWidth = sIconHeight = (int) resources.getDimension(android.R.dimen.app_icon_size);
        sIconTextureWidth = sIconTextureHeight = sIconWidth + 2;
 
        sBlurPaint.setMaskFilter(new BlurMaskFilter(5 * density, BlurMaskFilter.Blur.NORMAL));
        sGlowColorPressedPaint.setColor(0xffffc300);
        sGlowColorPressedPaint.setMaskFilter(TableMaskFilter.CreateClipTable(0, 30));
        sGlowColorFocusedPaint.setColor(0xffff8e00);
        sGlowColorFocusedPaint.setMaskFilter(TableMaskFilter.CreateClipTable(0, 30));
    } 
 
    static class BubbleText { 
        private static final int MAX_LINES = 2;
 
        private final TextPaint mTextPaint;
 
        private final float mBubblePadding;
        private final RectF mBubbleRect = new RectF();
 
4
CodeRank

Related Android BlurMaskFilter Questions & Answers:

See Code Examples for Android BlurMaskFilter Methods: