Code example for Paint

Methods: getAlpha

0
    } 
 
    @Override 
    public int getOpacity() { 
        Bitmap bm = mBitmap;
        return (bm == null || bm.hasAlpha() || mPaint.getAlpha() < 255) ?
                PixelFormat.TRANSLUCENT : PixelFormat.OPAQUE;
    } 
 
    @Override 
    public void setAlpha(int alpha) {
        int oldAlpha = mPaint.getAlpha();
        if (alpha != oldAlpha) {
            mPaint.setAlpha(alpha);
            invalidateSelf();
        } 
    } 
 
    @Override 
    public void setColorFilter(ColorFilter cf) {
        mPaint.setColorFilter(cf);