當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。