Paint setARGB - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Paint setARGB method.

This code example shows how to use the following methods:setARGB, setAntiAlias, setStrokeCap, setStrokeJoin, setStrokeWidth
			canvas.save();
			canvas.scale(w,h);
			if (!leftArrow) {
				canvas.translate(1, 0);
			} 
			Paint p = new Paint();
			p.setAntiAlias(false);
			p.setARGB(175, 216, 216, 216);
			p.setStyle(Paint.Style.FILL);
			canvas.drawPath(path, p);
			p.setARGB(75, 0, 0, 0);
			p.setStrokeWidth(0.1f);
			p.setStrokeJoin(Join.ROUND);
			p.setStrokeCap(Cap.ROUND);
			p.setAntiAlias(true);
			p.setStyle(Paint.Style.STROKE);
			canvas.drawPath(path, p);
			canvas.restore();
		} 
	} 
} 
8
CodeRank
This code example shows how to use the following methods:setARGB, setColor, setTextSize
				canvas.drawBitmap( bmp, mMatrix, mPaint );
			} 
		} 
 
		// colored background 
		mPaint.setColor( mColor );
		canvas.drawRect( 17 / xRatio, 37 / yRatio, 145 / xRatio, 225 / yRatio, mPaint );
 
		int saveCount = canvas.save( Canvas.MATRIX_SAVE_FLAG );
		canvas.rotate( 90 );
 
		// SHORT TITLE 
		mPaint.setColor( Color.BLACK );
		mPaint.setTextSize( leftTextSize );
		canvas.drawText( mShortTitle, 66 / xRatio, -26 / yRatio, mPaint );
 
		// TITLE 
		mPaint.setTextSize( titleTextSize );
		canvas.drawText( mTitle, 69 / xRatio, -88 / yRatio, mPaint );
 

8
CodeRank
This code example shows how to use the following methods:setARGB, setAntiAlias, setStyle, setTextAlign, setTextSize
    return brush;
  } // createOutlineBrush 
 
  static private Paint createBrush(final int a, final int r, final int g, final int b, final Style style)
	{ 
    final Paint paint = new Paint();
    paint.setAntiAlias(true);
    paint.setStyle(style);
    paint.setARGB(a, r, g, b);    
    return paint;
	} // createBrush 
	 
	static public Paint createTextBrush(final int size)
	{ 
		final Paint paint = createFillBrush(255, 255, 255, 255);
 
		paint.setTextAlign(Align.CENTER);
		paint.setTypeface(Typeface.DEFAULT);
		paint.setTextSize(size * 2);
		 

7
CodeRank
This code example shows how to use the following methods:setARGB, setAntiAlias, setStrokeWidth, setStyle
import android.widget.LinearLayout; 
 
public class TransparentLinearLayout  
extends LinearLayout
{ 
    private final Paint borderPaint = new Paint();;
     
    private final Paint backgroundPaint = new Paint();
     
    public TransparentLinearLayout(Context context)
    { 
        super(context);
        init();        
    } 
     
    public TransparentLinearLayout(Context context, AttributeSet attrs)
    { 
        super(context, attrs);
        init();        
    } 

7
CodeRank
This code example shows how to use the following methods:getStrokeWidth, setARGB, setAntiAlias, setPathEffect, setStrokeCap
7
CodeRank
This code example shows how to use the following methods:setARGB, setAntiAlias, setStrokeWidth, setStyle
	private void setupColors() { 
		innerColor = new Paint();
		innerColor.setARGB(225, 75, 75, 75);
		innerColor.setAntiAlias(true);
 
		borderColor = new Paint();
		borderColor.setARGB(255, 255, 255, 255);
		borderColor.setAntiAlias(true);
		borderColor.setStyle(Style.STROKE);
		borderColor.setStrokeWidth(LINE_WIDTH);
	} 
 
	@Override 
	protected void dispatchDraw(Canvas canvas) {
		RectF drawRect = new RectF();
		drawRect.set(0, 0, getMeasuredWidth(), getMeasuredHeight());
		// draw the panel 
		canvas.drawRoundRect(drawRect, 5, 5, innerColor);
		canvas.drawRoundRect(drawRect, 5, 5, borderColor);
		super.dispatchDraw(canvas);
7
CodeRank
This code example shows how to use the following methods:setARGB, setAlpha, setAntiAlias, setStrokeWidth, setStyle
This code example shows how to use the following methods:setARGB, setStrokeWidth, setStyle, setTypeface
		invalidate();
	} 
 
	private void setStrokePaint(){ 
		mTextPaint = getPaint();
		mStrokePaint = new TextPaint(mTextPaint);
		mStrokePaint.setTypeface(getTypeface());
		mStrokePaint.setStyle(Paint.Style.STROKE);
 
		// TODO make these properties that can be set from XML 
		mStrokePaint.setARGB(255, 0, 0, 0);
		mStrokePaint.setStrokeWidth(4);
	} 
 
	@Override 
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
	} 
 
	@Override 
7
CodeRank
This code example shows how to use the following methods:setARGB, setStyle
        mFullColor = fullColor;
        mStrikeWidth = strikeWidth;
        mStrikeHeight = strikeHeight;
        mTexelWidth = (float) (1.0 / mStrikeWidth);
        mTexelHeight = (float) (1.0 / mStrikeHeight);
        mClearPaint = new Paint();
        mClearPaint.setARGB(0, 0, 0, 0);
        mClearPaint.setStyle(Style.FILL);
        mState = STATE_NEW;
    } 
 
    /** 
     * Call to initialize the class. 
     * Call whenever the surface has been created. 
     * 
     * @param gl 
     */ 
    public void initialize(GL10 gl) {
        mState = STATE_INITIALIZED;
        int[] textures = new int[1];
6
CodeRank
This code example shows how to use the following methods:setARGB, setAntiAlias, setStrokeWidth, setStyle
            mTextBackgroundPaint.setAntiAlias(false);
            mTextBackgroundPaint.setARGB(128, 255, 255, 255);
            mTextLevelPaint = new Paint();
            mTextLevelPaint.setAntiAlias(false);
            mTextLevelPaint.setARGB(192, 255, 0, 0);
            mPaint = new Paint();
            mPaint.setAntiAlias(true);
            mPaint.setARGB(255, 255, 255, 255);
            mPaint.setStyle(Paint.Style.STROKE);
            mPaint.setStrokeWidth(2);
            mTargetPaint = new Paint();
            mTargetPaint.setAntiAlias(false);
            mTargetPaint.setARGB(192, 0, 0, 255);
            mPaint.setStyle(Paint.Style.STROKE);
            mPaint.setStrokeWidth(1);
        } 
 
        @Override 
        protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
6
CodeRank

Related Paint setARGB Questions & Answers:

setARGB Method Overview
Helper to setColor(), that takes a,r,g,b and constructs the color int
See Code Examples for other Android Paint Methods: