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


Java Paint.setStrokeJoin方法代码示例

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


在下文中一共展示了Paint.setStrokeJoin方法的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: setPaintStyle

import android.graphics.Paint; //导入方法依赖的package包/类
private void setPaintStyle() {
    mPaint = new Paint();
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setStrokeCap(Paint.Cap.ROUND);
    mPaint.setAntiAlias(true);
    mPaint.setDither(true);
    if (currentStyle == 1) {
        mPaint.setStrokeWidth(currentSize);
        mPaint.setColor(currentColor);
    } else {
        mPaint.setAlpha(0);
        mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
        mPaint.setColor(Color.TRANSPARENT);
        mPaint.setStrokeWidth(50);
    }

    mMaskPaint = new Paint();
    mMaskPaint.setStrokeWidth(3);
    mMaskPaint.setTextAlign(Paint.Align.RIGHT);
    mMaskPaint.setColor(Color.GREEN);
    mMaskPaint.setTextSize(40);
}
 
开发者ID:liuke2016,项目名称:filepicker,代码行数:24,代码来源:TuyaView.java

示例3: init

import android.graphics.Paint; //导入方法依赖的package包/类
private void init() {
    borderPaint = new Paint();
    borderPaint.setColor(borderColor);
    borderPaint.setStyle(Paint.Style.STROKE);
    borderPaint.setStrokeWidth(borderWidth);
    rectPaint = new Paint();
    rectPaint.setColor(rectColor);
    rectPaint.setStyle(Paint.Style.FILL);
    linePaint = new Paint();
    linePaint.setAntiAlias(true);
    linePaint.setColor(lineColor);
    linePaint.setStyle(Paint.Style.STROKE);
    linePaint.setStrokeWidth(lineWidth);
    linePaint.setStrokeJoin(Paint.Join.ROUND);
    textPaint = new TextPaint();
    textPaint.setAntiAlias(true);
    textPaint.setColor(textColor);
    textPaint.setTextSize(textSize);
    fm = textPaint.getFontMetrics();
    path = new Path();
    pathDst = new Path();
    pm = new PathMeasure();
    selectedIndex = -1;
}
 
开发者ID:huzenan,项目名称:EasyChart,代码行数:25,代码来源:EasyGraphHistogram.java

示例4: init

import android.graphics.Paint; //导入方法依赖的package包/类
private void init(Context context) {
    mPaint = new Paint();
    mPaint.setAntiAlias(true);

    mPaint.setColor(Color.RED);
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setStrokeCap(Paint.Cap.ROUND);


    mEraserPaint = new Paint();
    mEraserPaint.setAlpha(0);
    mEraserPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
    mEraserPaint.setAntiAlias(true);
    mEraserPaint.setDither(true);
    mEraserPaint.setStyle(Paint.Style.STROKE);
    mEraserPaint.setStrokeJoin(Paint.Join.ROUND);
    mEraserPaint.setStrokeCap(Paint.Cap.ROUND);
    mEraserPaint.setStrokeWidth(40);
}
 
开发者ID:viseator,项目名称:MontageCam,代码行数:20,代码来源:CustomPaintView.java

示例5: SimpleGraph

import android.graphics.Paint; //导入方法依赖的package包/类
private SimpleGraph(final int color, final long maxNsecs, final float width, final float height, final float strokeWidth)
{
    this.maxNsecs = maxNsecs;
    // this.width = width;
    this.height = height;
    nsecWidth = width / maxNsecs;
    
    paintStroke = new Paint();
    paintStroke.setColor(color);
    paintStroke.setAlpha(204); // 80%
    paintStroke.setStyle(Style.STROKE);
    paintStroke.setStrokeWidth(strokeWidth);
    paintStroke.setStrokeCap(Cap.ROUND);
    paintStroke.setStrokeJoin(Join.ROUND);
    paintStroke.setAntiAlias(true);
    
    paintFill = new Paint();
    paintFill.setColor(color);
    paintFill.setAlpha(51); // 20%
    paintFill.setStyle(Style.FILL);
    paintFill.setAntiAlias(true);
    
    pathStroke = new Path();
    pathFill = new Path();
}
 
开发者ID:rtr-nettest,项目名称:open-rmbt,代码行数:26,代码来源:SimpleGraph.java

示例6: UpdateLastEiditedBitmapForUndoLimit

import android.graphics.Paint; //导入方法依赖的package包/类
public void UpdateLastEiditedBitmapForUndoLimit() {
    Canvas canvas = new Canvas(lastEditedBitmap);
    for (int i = 0; i < 1; i += 1) {
        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);
        canvas.drawPath(paths.get(i), paint);
    }
}
 
开发者ID:asif-patel,项目名称:ImageEraser,代码行数:16,代码来源:MainActivity.java

示例7: CanvasView

import android.graphics.Paint; //导入方法依赖的package包/类
public CanvasView(Context c) {
    super(c);
    context = c;

    // we set a new Path
    mPath = new Path();

    // and we set a new Paint with the desired attributes
    mPaint = new Paint();
    mPaint.setAntiAlias(true);
    mPaint.setColor(Color.BLACK);
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setStrokeWidth(4f);
}
 
开发者ID:ajithvgiri,项目名称:Canvas-Library,代码行数:16,代码来源:CanvasView.java

示例8: initPaints

import android.graphics.Paint; //导入方法依赖的package包/类
/**
 * Initializes the {@code Paint} objects with the appropriate styles.
 */
private void initPaints() {
    mCirclePaint = new Paint();
    mCirclePaint.setAntiAlias(true);
    mCirclePaint.setDither(true);
    mCirclePaint.setColor(mCircleColor);
    mCirclePaint.setStrokeWidth(mCircleStrokeWidth);
    mCirclePaint.setStyle(Paint.Style.STROKE);
    mCirclePaint.setStrokeJoin(Paint.Join.ROUND);
    mCirclePaint.setStrokeCap(Paint.Cap.ROUND);

    mCircleFillPaint = new Paint();
    mCircleFillPaint.setAntiAlias(true);
    mCircleFillPaint.setDither(true);
    mCircleFillPaint.setColor(mCircleFillColor);
    mCircleFillPaint.setStyle(Paint.Style.FILL);

    mCircleProgressPaint = new Paint();
    mCircleProgressPaint.setAntiAlias(true);
    mCircleProgressPaint.setDither(true);
    mCircleProgressPaint.setColor(mCircleProgressColor);
    mCircleProgressPaint.setStrokeWidth(mCircleStrokeWidth);
    mCircleProgressPaint.setStyle(Paint.Style.STROKE);
    mCircleProgressPaint.setStrokeJoin(Paint.Join.ROUND);
    mCircleProgressPaint.setStrokeCap(Paint.Cap.ROUND);

    mCircleProgressGlowPaint = new Paint();
    mCircleProgressGlowPaint.set(mCircleProgressPaint);
    mCircleProgressGlowPaint.setMaskFilter(new BlurMaskFilter((5f * DPTOPX_SCALE), BlurMaskFilter.Blur.NORMAL));

    mPointerPaint = new Paint();
    mPointerPaint.setAntiAlias(true);
    mPointerPaint.setDither(true);
    mPointerPaint.setStyle(Paint.Style.FILL);
    mPointerPaint.setColor(mPointerColor);
    mPointerPaint.setStrokeWidth(mPointerRadius);

    mPointerHaloPaint = new Paint();
    mPointerHaloPaint.set(mPointerPaint);
    mPointerHaloPaint.setColor(mPointerHaloColor);
    mPointerHaloPaint.setAlpha(mPointerAlpha);
    mPointerHaloPaint.setStrokeWidth(mPointerRadius + mPointerHaloWidth);

    mPointerHaloBorderPaint = new Paint();
    mPointerHaloBorderPaint.set(mPointerPaint);
    mPointerHaloBorderPaint.setStrokeWidth(mPointerHaloBorderWidth);
    mPointerHaloBorderPaint.setStyle(Paint.Style.STROKE);

}
 
开发者ID:vpaliyX,项目名称:Melophile,代码行数:52,代码来源:CircularSeekBar.java

示例9: LineDrawItem

import android.graphics.Paint; //导入方法依赖的package包/类
public LineDrawItem(){
    // 内部构造器
    mPaint = new Paint();
    mPaint.setAntiAlias(true);
    mPaint.setStrokeWidth(10);
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setStrokeCap(Paint.Cap.ROUND);

}
 
开发者ID:zmobs,项目名称:DoChart,代码行数:10,代码来源:LineDrawItem.java

示例10: drawRoad

import android.graphics.Paint; //导入方法依赖的package包/类
private void drawRoad(Paint paint, Canvas canvas) {
    paint.setDither(true);
    paint.setColor(roadColor);
    paint.setStyle(Paint.Style.STROKE);
    paint.setStrokeWidth(roadStrokeWidth);
    paint.setStrokeCap(Paint.Cap.ROUND);
    paint.setStrokeJoin(Paint.Join.ROUND);
    canvas.drawCircle(circleCenterPointX, circleCenterPointY, roadRadius, paint);
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:10,代码来源:CircleRoadProgress.java

示例11: createPaint

import android.graphics.Paint; //导入方法依赖的package包/类
/**
 * This method creates the instance of Paint.
 * In addition, this method sets styles for Paint.
 *
 * @return paint This is returned as the instance of Paint
 */
private Paint createPaint() {
  Paint paint = new Paint();

  paint.setAntiAlias(true);
  paint.setStyle(this.paintStyle);
  paint.setStrokeWidth(this.paintStrokeWidth);
  paint.setStrokeCap(this.lineCap);
  paint.setStrokeJoin(Paint.Join.MITER);  // fixed

  // for Text
  if (this.mode == Mode.TEXT) {
    paint.setTypeface(this.fontFamily);
    paint.setTextSize(this.fontSize);
    paint.setTextAlign(this.textAlign);
    paint.setStrokeWidth(0F);
  }

  if (this.mode == Mode.ERASER) {
    // Eraser
    paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
    paint.setARGB(0, 0, 0, 0);

    // paint.setColor(this.baseColor);
    // paint.setShadowLayer(this.blur, 0F, 0F, this.baseColor);
  } else {
    // Otherwise
    paint.setColor(this.paintStrokeColor);
    paint.setShadowLayer(this.blur, 0F, 0F, this.paintStrokeColor);
    paint.setAlpha(this.opacity);
  }

  return paint;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:40,代码来源:CanvasView.java

示例12: initView

import android.graphics.Paint; //导入方法依赖的package包/类
/**
 * Inits paint objects and default values.
 */
private void initView() {
    starPath = new Path();
    cornerPathEffect = new CornerPathEffect(starCornerRadius);

    paintStarOutline = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
    paintStarOutline.setStyle(Paint.Style.FILL_AND_STROKE);
    paintStarOutline.setAntiAlias(true);
    paintStarOutline.setDither(true);
    paintStarOutline.setStrokeJoin(Paint.Join.ROUND);
    paintStarOutline.setStrokeCap(Paint.Cap.ROUND);
    paintStarOutline.setColor(Color.BLACK);
    paintStarOutline.setPathEffect(cornerPathEffect);

    paintStarBorder = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
    paintStarBorder.setStyle(Paint.Style.STROKE);
    paintStarBorder.setStrokeJoin(Paint.Join.ROUND);
    paintStarBorder.setStrokeCap(Paint.Cap.ROUND);
    paintStarBorder.setStrokeWidth(starBorderWidth);
    paintStarBorder.setPathEffect(cornerPathEffect);

    paintStarBackground = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
    paintStarBackground.setStyle(Paint.Style.FILL_AND_STROKE);
    paintStarBackground.setAntiAlias(true);
    paintStarBackground.setDither(true);
    paintStarBackground.setStrokeJoin(Paint.Join.ROUND);
    paintStarBackground.setStrokeCap(Paint.Cap.ROUND);

    paintStarFill = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
    paintStarFill.setStyle(Paint.Style.FILL_AND_STROKE);
    paintStarFill.setAntiAlias(true);
    paintStarFill.setDither(true);
    paintStarFill.setStrokeJoin(Paint.Join.ROUND);
    paintStarFill.setStrokeCap(Paint.Cap.ROUND);

    defaultStarSize = applyDimension(COMPLEX_UNIT_DIP, 30, getResources().getDisplayMetrics());
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:40,代码来源:SimpleRatingBar.java

示例13: init

import android.graphics.Paint; //导入方法依赖的package包/类
private void init() {
  mPath = new Path();
  mBitmapPaint = new Paint(Paint.DITHER_FLAG);
  mPaint = new Paint();
  mPaint.setAntiAlias(true);
  mPaint.setDither(true);
  mPaint.setColor(Color.WHITE);
  mPaint.setStyle(Paint.Style.STROKE);
  mPaint.setStrokeJoin(Paint.Join.ROUND);
  mPaint.setStrokeCap(Paint.Cap.ROUND);
  mPaint.setStrokeWidth(mPenSize);
  mDrawMode = true;
  mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SCREEN));
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:15,代码来源:DrawingView.java

示例14: drawPaths

import android.graphics.Paint; //导入方法依赖的package包/类
private void drawPaths(List<Path> paths) {
    mMap.draw(c);
    Paint paint = new Paint();
    paint.setColor(ContextCompat.getColor(this, R.color.grey500));
    paint.setStrokeWidth(10);
    paint.setStrokeJoin(Paint.Join.ROUND);
    for(Path path : paths){
        float startX = (float) (path.getStartX() * mapWidth);
        float endX = (float) (path.getEndX() * mapWidth);
        float startY = (float) (path.getStartY() * mapHeight);
        float endY = (float) (path.getEndY() * mapHeight);
        c.drawLine(startX, startY, endX, endY, paint);
    }
    mMap.setImageBitmap(bmp);
}
 
开发者ID:tringuyen1121,项目名称:Khonsu,代码行数:16,代码来源:MapNavActivity.java

示例15: init

import android.graphics.Paint; //导入方法依赖的package包/类
private void init(Context context, AttributeSet attrs) {
	TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.TagImageView);
	mTagOrientation = ta.getInteger(R.styleable.TagImageView_tagOrientation, 0);
	mTagBackgroundColor = ta.getColor(R.styleable.TagImageView_tagBackgroundColor, mTagBackgroundColor);
	mCornerDistance = ta.getDimension(R.styleable.TagImageView_tagCornerDistance, mCornerDistance);
	mTagWidth = ta.getDimension(R.styleable.TagImageView_tagWidth, mTagWidth);
	String tagText = ta.getString(R.styleable.TagImageView_tagText);
	if (!TextUtils.isEmpty(tagText)) {
		mTagText = tagText;
	}
	mTagTextSize = ta.getDimension(R.styleable.TagImageView_tagTextSize, mTagTextSize);
	mTagTextColor = ta.getColor(R.styleable.TagImageView_tagTextColor, mTagTextColor);
	mTagTextDownX = ta.getDimension(R.styleable.TagImageView_tagTextDownX, mTagTextDownX);
	mTagTextRotate = ta.getInteger(R.styleable.TagImageView_tagTextRotate, mTagTextRotate);
	isEnable = ta.getBoolean(R.styleable.TagImageView_tagEnable, isEnable);
	ta.recycle();

	mStartPoint = new Point();
	mEndPoint = new Point();
	mTagTextBound = new Rect();

	mTagPath = new Path();

	mTagBgPaint = new Paint();
	mTagBgPaint.setAntiAlias(true);
	mTagBgPaint.setDither(true);
	mTagBgPaint.setStyle(Paint.Style.STROKE);
	mTagBgPaint.setStrokeJoin(Paint.Join.ROUND);
	mTagBgPaint.setStrokeCap(Paint.Cap.SQUARE);

	mTagTextPaint = new Paint();
	mTagBgPaint.setAntiAlias(true);
	mTagTextPaint.setDither(false);
}
 
开发者ID:A-Miracle,项目名称:QiangHongBao,代码行数:35,代码来源:TagImageView.java


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