当前位置: 首页>>代码示例>>Java>>正文


Java Paint.setStrokeCap方法代码示例

本文整理汇总了Java中android.graphics.Paint.setStrokeCap方法的典型用法代码示例。如果您正苦于以下问题:Java Paint.setStrokeCap方法的具体用法?Java Paint.setStrokeCap怎么用?Java Paint.setStrokeCap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.graphics.Paint的用法示例。


在下文中一共展示了Paint.setStrokeCap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: UpdateCanvas

import android.graphics.Paint; //导入方法依赖的package包/类
public void UpdateCanvas() {
    canvasMaster.drawColor(0, Mode.CLEAR);
    canvasMaster.drawBitmap(lastEditedBitmap, 0.0f, 0.0f, null);
    int i = 0;
    while (true) {
        if (i >= paths.size()) {
            break;
        }
        int brushSize = brushSizes.get(i);
        Paint paint = new Paint();
        paint.setColor(0);
        paint.setStyle(Style.STROKE);
        paint.setAntiAlias(true);
        paint.setStrokeJoin(Join.ROUND);
        paint.setStrokeCap(Cap.ROUND);
        paint.setXfermode(new PorterDuffXfermode(Mode.SRC));
        paint.setStrokeWidth((float) brushSize);
        canvasMaster.drawPath(paths.get(i), paint);
        i += 1;
    }
    touchImageView.invalidate();
}
 
开发者ID:asif-patel,项目名称:ImageEraser,代码行数:23,代码来源:MainActivity.java

示例2: initConfig

import android.graphics.Paint; //导入方法依赖的package包/类
@Override
protected void initConfig(int x, int y) {
    mPaint = new Paint();
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeWidth(mStrokeWidth);
    mPaint.setAntiAlias(true);
    mPaint.setColor(Config.WHITE);
    mPaint.setStrokeCap(Paint.Cap.SQUARE);

    mRectF = new RectF(x - MAX_RADIUS_CIRCLE
            , y - MAX_RADIUS_CIRCLE
            , x + MAX_RADIUS_CIRCLE
            , y + MAX_RADIUS_CIRCLE);
    mFirstPoint = new Point(x - MAX_RADIUS_CIRCLE, y);
    mSecondPoint = new Point(mFirstPoint);
}
 
开发者ID:chengkun123,项目名称:ReadMark,代码行数:17,代码来源:ELetter.java

示例3: initConfig

import android.graphics.Paint; //导入方法依赖的package包/类
@Override
protected void initConfig(int x, int y) {
    mPaint = new Paint();
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeWidth(mStrokeWidth);
    mPaint.setAntiAlias(true);
    mPaint.setColor(Config.WHITE);
    mPaint.setStrokeCap(Paint.Cap.SQUARE);

    mRectF = new RectF(x - MAX_RADIUS_CIRCLE
            , y - MAX_RADIUS_CIRCLE
            , x + MAX_RADIUS_CIRCLE
            , y + MAX_RADIUS_CIRCLE);
    mFirPoint = new Point(x + MAX_RADIUS_CIRCLE, y - 2 * MAX_RADIUS_CIRCLE);
    mSecPoint = new Point(mFirPoint);
}
 
开发者ID:chengkun123,项目名称:ReadMark,代码行数:17,代码来源:DLetter.java

示例4: initPaints

import android.graphics.Paint; //导入方法依赖的package包/类
private void initPaints() {
        mSmallScalePaint = new Paint();
        mSmallScalePaint.setStrokeWidth(mParent.getSmallScaleWidth());
        mSmallScalePaint.setColor(mParent.getScaleColor());
        mSmallScalePaint.setStrokeCap(Paint.Cap.ROUND);;

        mBigScalePaint = new Paint();
        mBigScalePaint.setColor(mParent.getScaleColor());
        mBigScalePaint.setStrokeWidth(mParent.getBigScaleWidth());
        mBigScalePaint.setStrokeCap(Paint.Cap.ROUND);;

        mTextPaint = new Paint();
        mTextPaint.setAntiAlias(true);
        mTextPaint.setColor(mParent.getTextColor());
        mTextPaint.setTextSize(mParent.getTextSize());
        mTextPaint.setTextAlign(Paint.Align.CENTER);
//        mTextPaint.setStrokeJoin(Paint.Join.ROUND);
        mOutLinePaint = new Paint();
        mOutLinePaint.setStrokeWidth(0);
        mOutLinePaint.setColor(mParent.getScaleColor());
    }
 
开发者ID:totond,项目名称:BooheeRuler,代码行数:22,代码来源:InnerRuler.java

示例5: init

import android.graphics.Paint; //导入方法依赖的package包/类
private void init() {
    paint = new Paint();
    paint.setColor(bgColor);
    paint.setStrokeCap(Paint.Cap.ROUND);
    paint.setAntiAlias(true);

    toBgPainter = new Paint();
    toBgPainter.setColor(toBgColor);
    toBgPainter.setStrokeCap(Paint.Cap.ROUND);
    toBgPainter.setAntiAlias(true);
    toBgPainter.setAlpha(0);

    initColorAnimator();
    ballMoveObservable.addObserver(this);
}
 
开发者ID:tranleduy2000,项目名称:screenfilter,代码行数:16,代码来源:BasePainter.java

示例6: setStroke

import android.graphics.Paint; //导入方法依赖的package包/类
private void setStroke(Cap cap, Join join, float miter, Style style, PathEffect pathEffect,
    Paint paint) {
  paint.setStrokeCap(cap);
  paint.setStrokeJoin(join);
  paint.setStrokeMiter(miter);
  paint.setPathEffect(pathEffect);
  paint.setStyle(style);
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:9,代码来源:XYChart.java

示例7: CubeEngine

import android.graphics.Paint; //导入方法依赖的package包/类
CubeEngine() {
    // Create a Paint to draw the lines for our cube
    final Paint paint = mPaint;
    paint.setColor(0xffffffff);
    paint.setAntiAlias(true);
    paint.setStrokeWidth(2);
    paint.setStrokeCap(Paint.Cap.ROUND);
    paint.setStyle(Paint.Style.STROKE);

    mStartTime = SystemClock.elapsedRealtime();

    mPrefs = CubeWallpaper2.this.getSharedPreferences(SHARED_PREFS_NAME, 0);
    mPrefs.registerOnSharedPreferenceChangeListener(this);
    onSharedPreferenceChanged(mPrefs, null);
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:16,代码来源:CubeWallpaper2.java

示例8: getArcPaint

import android.graphics.Paint; //导入方法依赖的package包/类
private Paint getArcPaint() {
  Paint paint = new Paint();
  paint.setColor(ContextCompat.getColor(this, R.color.temp_color));
  paint.setStrokeWidth(20);
  paint.setAntiAlias(true);
  paint.setStrokeCap(Paint.Cap.SQUARE);
  paint.setStyle(Paint.Style.STROKE);
  return paint;
}
 
开发者ID:wotomas,项目名称:VoiceRipple,代码行数:10,代码来源:MainActivity.java

示例9: initConfig

import android.graphics.Paint; //导入方法依赖的package包/类
@Override
protected void initConfig() {
    mEndMovingLength = -130;
    mPaint = new Paint();
    //mPaint.setStyle(Paint.Style.STROKE);
    //设置画一条直线后结尾处的形状
    mPaint.setStrokeCap(Paint.Cap.ROUND);
    //设置连接处的形状
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setAntiAlias(true);
}
 
开发者ID:chengkun123,项目名称:ReadMark,代码行数:12,代码来源:SecondCake.java

示例10: initConfig

import android.graphics.Paint; //导入方法依赖的package包/类
@Override
protected void initConfig(int x, int y) {
    mPaint = new Paint();
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeWidth(mStrokeWidth);
    mPaint.setAntiAlias(true);
    mPaint.setColor(Config.WHITE);
    mPaint.setStrokeCap(Paint.Cap.SQUARE);

    mLength1 = 3 * MAX_RADIUS_CIRCLE;
    //mLength2 = (int) Math.sqrt(MAX_RADIUS_CIRCLE * MAX_RADIUS_CIRCLE + MAX_RADIUS_CIRCLE * MAX_RADIUS_CIRCLE);

    mCircleX = x;
    mCircleY = y - MAX_RADIUS_CIRCLE;

    mRectF = new RectF(mCircleX - MAX_RADIUS_CIRCLE
            , mCircleY - MAX_RADIUS_CIRCLE
            , mCircleX + MAX_RADIUS_CIRCLE
            , mCircleY + MAX_RADIUS_CIRCLE);


    mFirstPoint = new Point(x - MAX_RADIUS_CIRCLE
            , y - 2 * MAX_RADIUS_CIRCLE);
    mSecondPoint = new Point(mFirstPoint);

    mThirdPoint = new Point(x - MAX_RADIUS_CIRCLE, y + MAX_RADIUS_CIRCLE / 4);
    mFourthPoint = new Point(mThirdPoint);
    mFifthPoint = new Point(mThirdPoint);
}
 
开发者ID:chengkun123,项目名称:ReadMark,代码行数:30,代码来源:RLetter.java

示例11: initConfig

import android.graphics.Paint; //导入方法依赖的package包/类
@Override
protected void initConfig(int x, int y) {
    mPaint = new Paint();
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeWidth(mStrokeWidth);
    mPaint.setAntiAlias(true);
    mPaint.setColor(Config.WHITE);
    mPaint.setStrokeCap(Paint.Cap.SQUARE);

    mFirPoint = new Point(x, y - 2 * MAX_RADIUS_CIRCLE);
    mSecPoint = new Point(mFirPoint);
    mThiPoint = new Point(mFirPoint);
    mFourPoint = new Point(mFirPoint);
}
 
开发者ID:chengkun123,项目名称:ReadMark,代码行数:15,代码来源:MLetter.java

示例12: onDraw

import android.graphics.Paint; //导入方法依赖的package包/类
@Override
protected void onDraw(Canvas canvas) {
	super.onDraw(canvas);

	// ����ͼ��ı���ɫ
	canvas.drawColor(Color.TRANSPARENT);
	// ��ӻ���
	Paint paint_Line = new Paint();
	paint_Line.setAntiAlias(true); // �����
	paint_Line.setStrokeWidth(2); // ���û��ʿ��
	paint_Line.setStyle(Style.STROKE);
	paint_Line.setColor(Color.BLUE); // ���ʵ���ɫ

	Paint paint_Point = new Paint();
	paint_Point.setAntiAlias(true); // �����
	paint_Point.setStrokeWidth(8); // ���û��ʿ��
	paint_Point.setStyle(Style.STROKE);
	paint_Point.setColor(Color.RED); // ���ʵ���ɫ
	paint_Point.setStrokeCap(Cap.ROUND);//Բͷ�Ļ���ͷ
	
	
		
	
	switch (test_flag) {
	case 0:          //�ӱ������ݿ��õ��ĵ�
		drawDpPoint(canvas, testPoints, paint_Point);
		break;
	
	case 1:          //�ӷ���������õ���
		drawDpPoint(canvas, testPoint, paint_Point);
		break;
	default:
		break;
	}
}
 
开发者ID:HyfUestc,项目名称:PDR,代码行数:36,代码来源:MapView.java

示例13: draw

import android.graphics.Paint; //导入方法依赖的package包/类
@Override
public void draw(@NonNull Canvas canvas, CharSequence text, @IntRange(from = 0) int start, @IntRange(from = 0) int end, float x, int top, int y, int bottom, @NonNull Paint paint) {
  canvas.save();
  canvas.translate(mStrokeWidth, 0);
  paint.setColor(mStrokeColor);
  paint.setStrokeCap(Paint.Cap.ROUND);
  paint.setStrokeWidth(mStrokeWidth);
  paint.setStyle(Paint.Style.STROKE);
  canvas.drawText(text, start, end, x, y, paint);
  paint.setColor(mTextColor);
  paint.setStyle(Paint.Style.FILL);
  canvas.drawText(text, start, end, x, y, paint);
  canvas.restore();
}
 
开发者ID:lsjwzh,项目名称:FastTextView,代码行数:15,代码来源:StrokeReplacementSpan.java

示例14: init

import android.graphics.Paint; //导入方法依赖的package包/类
private void init() {
    drawRoundRectRadius = dpToPx(5);
    setScaleType(ImageView.ScaleType.FIT_XY);

    clickableStroke = new Paint(Paint.ANTI_ALIAS_FLAG);
    clickableStroke.setStrokeWidth(1f);
    clickableStroke.setStyle(Paint.Style.STROKE);
    clickableStroke.setStrokeCap(Paint.Cap.ROUND);
    clickableStroke.setColor(Color.BLUE);

    clickFill = new Paint(Paint.ANTI_ALIAS_FLAG);
    clickFill.setStyle(Paint.Style.FILL_AND_STROKE);
    clickFill.setStrokeCap(Paint.Cap.ROUND);
    clickFill.setColor(Color.BLUE);
    clickFill.setAlpha(70);

    clickStroke = new Paint(Paint.ANTI_ALIAS_FLAG);
    clickStroke.setStyle(Paint.Style.STROKE);
    clickStroke.setColor(Color.BLUE);
    clickStroke.setStrokeWidth(2f);
    clickStroke.setStrokeCap(Paint.Cap.ROUND);

    warnFill = new Paint(Paint.ANTI_ALIAS_FLAG);
    warnFill.setStyle(Paint.Style.FILL_AND_STROKE);
    warnFill.setStrokeCap(Paint.Cap.ROUND);
    warnFill.setColor(Color.YELLOW);
    warnFill.setAlpha(70);

    warnStroke = new Paint(Paint.ANTI_ALIAS_FLAG);
    warnStroke.setStyle(Paint.Style.STROKE);
    warnStroke.setColor(Color.YELLOW);
    warnStroke.setStrokeWidth(2f);
    warnStroke.setStrokeCap(Paint.Cap.ROUND);

    setOnTouchListener(this);
    gestureDetector = new GestureDetector(getContext(), new OnGestureListenerAnchor(this));
}
 
开发者ID:jcodeing,项目名称:AnchorImageView,代码行数:38,代码来源:AnchorImageView.java

示例15: initView

import android.graphics.Paint; //导入方法依赖的package包/类
private void initView(Context context) {
    bgArcColor = Color.parseColor("#33f4f4f4");

    //背景
    allArcPaint = new Paint();
    allArcPaint.setAntiAlias(true);
    allArcPaint.setStyle(Paint.Style.FILL);
    allArcPaint.setColor(bgArcColor);
    allArcPaint.setStrokeCap(Paint.Cap.ROUND);

    mCenterCirclePaint = new Paint();
    mCenterCirclePaint.setAntiAlias(true);
    mCenterCirclePaint.setStyle(Paint.Style.FILL);
    mCenterCirclePaint.setColor(Color.WHITE);
    mCenterCirclePaint.setStrokeCap(Paint.Cap.ROUND);

    centerPaint = new Paint();
    centerPaint.setAntiAlias(true);
    centerPaint.setStyle(Paint.Style.FILL);
    centerPaint.setColor(Color.argb(255, 255, 45, 53));
    centerPaint.setStrokeCap(Paint.Cap.ROUND);

    //当前进度
    progressPaint = new Paint();
    progressPaint.setAntiAlias(true);
    progressPaint.setStyle(Paint.Style.STROKE);
    progressPaint.setStrokeWidth(progressWidth);
    progressPaint.setColor(Color.argb(255, 255, 45, 53));
    progressPaint.setStrokeCap(Paint.Cap.ROUND);
}
 
开发者ID:sunshinecoast,项目名称:ScreenRecordCaptureMaster,代码行数:31,代码来源:ProgressButtonView.java


注:本文中的android.graphics.Paint.setStrokeCap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。