new Corner Paint - Android Graphics

Android examples for Graphics:Paint

Description

new Corner Paint

Demo Code


//package com.java2s;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.TypedValue;

public class Main {
    private static final int DEFAULT_CORNER_COLOR1 = Color.RED;
    private static final float DEFAULT_CORNER_THICKNESS_DP = 5;

    public static Paint newCornerPaint1(Context context) {

        // Set the line thickness for the crop window border.
        final float lineThicknessPx = TypedValue.applyDimension(
                TypedValue.COMPLEX_UNIT_DIP, DEFAULT_CORNER_THICKNESS_DP,
                context.getResources().getDisplayMetrics());

        final Paint cornerPaint = new Paint();
        cornerPaint.setColor(DEFAULT_CORNER_COLOR1);
        cornerPaint.setStrokeWidth(lineThicknessPx);
        cornerPaint.setStyle(Paint.Style.STROKE);

        return cornerPaint;
    }//from   www  .  j  a v a  2  s  . com
}

Related Tutorials