java类android.graphics.Paint.Join的实例源码

MultiBoxTracker.java 文件源码 项目:snu-artoon 阅读 26 收藏 0 点赞 0 评论 0
public MultiBoxTracker(final Context context) {
  this.context = context;
  for (final int color : COLORS) {
    availableColors.add(color);
  }

  boxPaint.setColor(Color.RED);
  boxPaint.setStyle(Style.STROKE);
  boxPaint.setStrokeWidth(12.0f);
  boxPaint.setStrokeCap(Cap.ROUND);
  boxPaint.setStrokeJoin(Join.ROUND);
  boxPaint.setStrokeMiter(100);

  textSizePx =
      TypedValue.applyDimension(
          TypedValue.COMPLEX_UNIT_DIP, TEXT_SIZE_DIP, context.getResources().getDisplayMetrics());
  borderedText = new BorderedText(textSizePx);
}
SimpleGraph.java 文件源码 项目:open-rmbt 阅读 25 收藏 0 点赞 0 评论 0
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();
}
StaticGraph.java 文件源码 项目:open-rmbt 阅读 30 收藏 0 点赞 0 评论 0
private StaticGraph(final int color, final float width, final float height, final float strokeWidth)
{
    this.height = height;
    this.width = width;

    pathStroke = new Path();
    pathFill = new Path();
    paintStroke = new Paint();
    paintFill = 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.setColor(color);
    paintFill.setAlpha(51); // 20%
    paintFill.setStyle(Style.FILL);
    paintFill.setAntiAlias(true);
}
SmoothGraph.java 文件源码 项目:open-rmbt 阅读 31 收藏 0 点赞 0 评论 0
private SmoothGraph(final int color, final float width, final float height, final float strokeWidth)
{
    this.height = height;
    this.width = width;

    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();
}
MainActivity.java 文件源码 项目:ImageEraser 阅读 25 收藏 0 点赞 0 评论 0
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();
}
Graphics.java 文件源码 项目:TreebolicLib 阅读 35 收藏 0 点赞 0 评论 0
/**
 * Construct
 *
 * @param canvas0 canvas
 */
public Graphics(final Canvas canvas0)
{
    super();
    this.canvas = canvas0;
    // if (theScale != 1F)
    // this.canvas.scale(theScale, theScale, this.canvas.getWidth() / 2F, this.canvas.getHeight() / 2F);
    // if (Graphics.scale != 1F)
    // this.theCanvas.scale(Graphics.scale, Graphics.scale, this.theCanvas.getWidth() / 2F, this.theCanvas.getHeight() / 2F);

    this.paint = new Paint();
    this.paint.setAntiAlias(true);
    this.paint.setHinting(Paint.HINTING_ON); // font

    this.paint.setStrokeWidth(2);
    this.paint.setStrokeCap(Cap.BUTT);
    this.paint.setStrokeJoin(Join.BEVEL);
    this.paint.setStrokeMiter(1);
    this.paint.setColor(android.graphics.Color.WHITE);
}
DrawerArrowDrawable.java 文件源码 项目:boohee_v5.6 阅读 37 收藏 0 点赞 0 评论 0
public DrawerArrowDrawable(Context context) {
    this.mPaint.setStyle(Style.STROKE);
    this.mPaint.setStrokeJoin(Join.MITER);
    this.mPaint.setStrokeCap(Cap.BUTT);
    this.mPaint.setAntiAlias(true);
    TypedArray a = context.getTheme().obtainStyledAttributes(null, R.styleable.DrawerArrowToggle, R.attr.drawerArrowStyle, R.style.Base_Widget_AppCompat_DrawerArrowToggle);
    setColor(a.getColor(R.styleable.DrawerArrowToggle_color, 0));
    setBarThickness(a.getDimension(R.styleable.DrawerArrowToggle_thickness, 0.0f));
    setSpinEnabled(a.getBoolean(R.styleable.DrawerArrowToggle_spinBars, true));
    setGapSize((float) Math.round(a.getDimension(R.styleable.DrawerArrowToggle_gapBetweenBars, 0.0f)));
    this.mSize = a.getDimensionPixelSize(R.styleable.DrawerArrowToggle_drawableSize, 0);
    this.mBarLength = (float) Math.round(a.getDimension(R.styleable.DrawerArrowToggle_barLength, 0.0f));
    this.mArrowHeadLength = (float) Math.round(a.getDimension(R.styleable.DrawerArrowToggle_arrowHeadLength, 0.0f));
    this.mArrowShaftLength = a.getDimension(R.styleable.DrawerArrowToggle_arrowShaftLength, 0.0f);
    a.recycle();
}
BarItem.java 文件源码 项目:Play2 阅读 29 收藏 0 点赞 0 评论 0
@SuppressLint("DrawAllocation")
@Override
protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    Paint paint = new Paint();  
    paint.setAntiAlias(true);
    paint.setColor(lineColor);  
    paint.setStrokeWidth(lineWidth);
    paint.setStrokeCap(Cap.ROUND);
    paint.setStrokeJoin(Join.ROUND);
    paint.setStyle(Style.STROKE);
    Path path = new Path();
    path.moveTo(startPoint.x, startPoint.y);
    path.lineTo(endPoint.x, endPoint.y);
    canvas.setMatrix(mMatrix);
    canvas.drawPath(path, paint);
}
BookmarkDrawable.java 文件源码 项目:MangaJunkie-Android 阅读 22 收藏 0 点赞 0 评论 0
public BookmarkDrawable() {
    FILL_PAINT   = new Paint();
    STROKE_PAINT = new Paint();
    SHADOW_PAINT = new Paint();
    TEXT_PAINT   = new Paint();

    FILL_PAINT.setStyle( Paint.Style.FILL );

    STROKE_PAINT.setStyle( Paint.Style.STROKE );
    STROKE_PAINT.setStrokeWidth( 2 );
    STROKE_PAINT.setStrokeJoin( Join.ROUND );
    STROKE_PAINT.setAntiAlias( true );

    SHADOW_PAINT.setStyle( Paint.Style.FILL_AND_STROKE );
    SHADOW_PAINT.setStrokeWidth( 2 );
    SHADOW_PAINT.setStrokeJoin( Join.ROUND );
    SHADOW_PAINT.setAntiAlias( true );
    SHADOW_PAINT.setARGB( 48, 0, 0, 0 );

    TEXT_PAINT.setStyle(     Paint.Style.FILL         );
    TEXT_PAINT.setTypeface(  Typeface   .DEFAULT_BOLD );
    TEXT_PAINT.setTextAlign( Align      .CENTER       );
    TEXT_PAINT.setAntiAlias( true                     );
}
OverlayDemo.java 文件源码 项目:MarkerDragForTencentMap 阅读 21 收藏 0 点赞 0 评论 0
private void drawPolyline(Canvas canvas, MapView mapView)
{
    Point ptLine1=mapView.getProjection().toPixels(geoPolyLine1, null);
    Point ptLine2=mapView.getProjection().toPixels(geoPolyLine2, null);
    Point ptLine3=mapView.getProjection().toPixels(geoPolyLine3, null);
    Point ptLine4=mapView.getProjection().toPixels(geoPolyLine4, null);

    Path pathLine=new Path();
    pathLine.moveTo(ptLine1.x, ptLine1.y);
    pathLine.lineTo(ptLine2.x, ptLine2.y);
    pathLine.lineTo(ptLine3.x, ptLine3.y);
    pathLine.lineTo(ptLine4.x, ptLine4.y);

    Paint paintLine=new Paint();
    paintLine.setStyle(Style.STROKE);
    paintLine.setStrokeWidth(10);
    paintLine.setColor(Color.BLUE);
    paintLine.setAntiAlias(true);
    paintLine.setStrokeCap(Cap.ROUND);
    paintLine.setStrokeJoin(Join.ROUND);

    canvas.drawPath(pathLine, paintLine);
}
OverlayDemo.java 文件源码 项目:MarkerDragForTencentMap 阅读 24 收藏 0 点赞 0 评论 0
private void drawPolygon(Canvas canvas, MapView mapView)
{
    Point ptpolygon1=mapView.getProjection().toPixels(geoPolygon1, null);
    Point ptpolygon2=mapView.getProjection().toPixels(geoPolygon2, null);
    Point ptpolygon3=mapView.getProjection().toPixels(geoPolygon3, null);
    Point ptpolygon4=mapView.getProjection().toPixels(geoPolygon4, null);

    Path pathpolygon=new Path();
    pathpolygon.moveTo(ptpolygon1.x, ptpolygon1.y);
    pathpolygon.lineTo(ptpolygon2.x, ptpolygon2.y);
    pathpolygon.lineTo(ptpolygon3.x, ptpolygon3.y);
    pathpolygon.lineTo(ptpolygon4.x, ptpolygon4.y);

    Paint paintpolygon=new Paint();
    paintpolygon.setStyle(Style.FILL);
    paintpolygon.setStrokeWidth(10);
    paintpolygon.setColor(Color.BLUE);
    paintpolygon.setAntiAlias(true);
    paintpolygon.setStrokeCap(Cap.ROUND);
    paintpolygon.setStrokeJoin(Join.ROUND);

    canvas.drawPath(pathpolygon, paintpolygon);
}
MultiBoxTracker.java 文件源码 项目:TensorflowAndroidDemo 阅读 28 收藏 0 点赞 0 评论 0
public MultiBoxTracker(final DisplayMetrics metrics) {
  for (final int color : COLORS) {
    availableColors.add(color);
  }

  boxPaint.setColor(Color.RED);
  boxPaint.setStyle(Style.STROKE);
  boxPaint.setStrokeWidth(12.0f);
  boxPaint.setStrokeCap(Cap.ROUND);
  boxPaint.setStrokeJoin(Join.ROUND);
  boxPaint.setStrokeMiter(100);

  textSizePx = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, TEXT_SIZE_DIP, metrics);
  borderedText = new BorderedText(textSizePx);
}
ColorPicker.java 文件源码 项目:airgram 阅读 26 收藏 0 点赞 0 评论 0
private void drawPointerArrow(Canvas canvas) {

        int centerX = getWidth() / 2;
        int centerY = getHeight() / 2;

        double tipAngle = (colorHSV[2] - 0.5f) * Math.PI;
        double leftAngle = tipAngle + Math.PI / 96;
        double rightAngle = tipAngle - Math.PI / 96;

        double tipAngleX = Math.cos(tipAngle) * outerWheelRadius;
        double tipAngleY = Math.sin(tipAngle) * outerWheelRadius;
        double leftAngleX = Math.cos(leftAngle) * (outerWheelRadius + arrowPointerSize);
        double leftAngleY = Math.sin(leftAngle) * (outerWheelRadius + arrowPointerSize);
        double rightAngleX = Math.cos(rightAngle) * (outerWheelRadius + arrowPointerSize);
        double rightAngleY = Math.sin(rightAngle) * (outerWheelRadius + arrowPointerSize);

        arrowPointerPath.reset();
        arrowPointerPath.moveTo((float) tipAngleX + centerX, (float) tipAngleY + centerY);
        arrowPointerPath.lineTo((float) leftAngleX + centerX, (float) leftAngleY + centerY);
        arrowPointerPath.lineTo((float) rightAngleX + centerX, (float) rightAngleY + centerY);
        arrowPointerPath.lineTo((float) tipAngleX + centerX, (float) tipAngleY + centerY);

        valuePointerArrowPaint.setColor(Color.HSVToColor(colorHSV));
        valuePointerArrowPaint.setStyle(Style.FILL);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

        valuePointerArrowPaint.setStyle(Style.STROKE);
        valuePointerArrowPaint.setStrokeJoin(Join.ROUND);
        valuePointerArrowPaint.setColor(Color.BLACK);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

    }
MultiColorPicker.java 文件源码 项目:airgram 阅读 22 收藏 0 点赞 0 评论 0
private void drawPointerArrow(Canvas canvas) {

        int centerX = getWidth() / 2;
        int centerY = getHeight() / 2;

        double tipAngle = (colorHSV[2] - 0.5f) * Math.PI;
        double leftAngle = tipAngle + Math.PI / 96;
        double rightAngle = tipAngle - Math.PI / 96;

        double tipAngleX = Math.cos(tipAngle) * outerWheelRadius;
        double tipAngleY = Math.sin(tipAngle) * outerWheelRadius;
        double leftAngleX = Math.cos(leftAngle) * (outerWheelRadius + arrowPointerSize);
        double leftAngleY = Math.sin(leftAngle) * (outerWheelRadius + arrowPointerSize);
        double rightAngleX = Math.cos(rightAngle) * (outerWheelRadius + arrowPointerSize);
        double rightAngleY = Math.sin(rightAngle) * (outerWheelRadius + arrowPointerSize);

        arrowPointerPath.reset();
        arrowPointerPath.moveTo((float) tipAngleX + centerX, (float) tipAngleY + centerY);
        arrowPointerPath.lineTo((float) leftAngleX + centerX, (float) leftAngleY + centerY);
        arrowPointerPath.lineTo((float) rightAngleX + centerX, (float) rightAngleY + centerY);
        arrowPointerPath.lineTo((float) tipAngleX + centerX, (float) tipAngleY + centerY);

        valuePointerArrowPaint.setColor(Color.HSVToColor(colorHSV));
        valuePointerArrowPaint.setStyle(Style.FILL);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

        valuePointerArrowPaint.setStyle(Style.STROKE);
        valuePointerArrowPaint.setStrokeJoin(Join.ROUND);
        valuePointerArrowPaint.setColor(Color.BLACK);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

    }
XYChart.java 文件源码 项目:buildAPKsApps 阅读 33 收藏 0 点赞 0 评论 0
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);
}
ColorPicker.java 文件源码 项目:buildAPKsApps 阅读 22 收藏 0 点赞 0 评论 0
private void drawPointerArrow(Canvas canvas) {

        int centerX = getWidth() / 2;
        int centerY = getHeight() / 2;

        double tipAngle = (colorHSV[2] - 0.5f) * Math.PI;
        double leftAngle = tipAngle + Math.PI / 96;
        double rightAngle = tipAngle - Math.PI / 96;

        double tipAngleX = Math.cos(tipAngle) * outerWheelRadius;
        double tipAngleY = Math.sin(tipAngle) * outerWheelRadius;
        double leftAngleX = Math.cos(leftAngle) * (outerWheelRadius + arrowPointerSize);
        double leftAngleY = Math.sin(leftAngle) * (outerWheelRadius + arrowPointerSize);
        double rightAngleX = Math.cos(rightAngle) * (outerWheelRadius + arrowPointerSize);
        double rightAngleY = Math.sin(rightAngle) * (outerWheelRadius + arrowPointerSize);

        arrowPointerPath.reset();
        arrowPointerPath.moveTo((float) tipAngleX + centerX, (float) tipAngleY + centerY);
        arrowPointerPath.lineTo((float) leftAngleX + centerX, (float) leftAngleY + centerY);
        arrowPointerPath.lineTo((float) rightAngleX + centerX, (float) rightAngleY + centerY);
        arrowPointerPath.lineTo((float) tipAngleX + centerX, (float) tipAngleY + centerY);

        valuePointerArrowPaint.setColor(Color.HSVToColor(colorHSV));
        valuePointerArrowPaint.setStyle(Style.FILL);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

        valuePointerArrowPaint.setStyle(Style.STROKE);
        valuePointerArrowPaint.setStrokeJoin(Join.ROUND);
        valuePointerArrowPaint.setColor(Color.BLACK);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

    }
MultiColorPicker.java 文件源码 项目:buildAPKsApps 阅读 27 收藏 0 点赞 0 评论 0
private void drawPointerArrow(Canvas canvas) {

        int centerX = getWidth() / 2;
        int centerY = getHeight() / 2;

        double tipAngle = (colorHSV[2] - 0.5f) * Math.PI;
        double leftAngle = tipAngle + Math.PI / 96;
        double rightAngle = tipAngle - Math.PI / 96;

        double tipAngleX = Math.cos(tipAngle) * outerWheelRadius;
        double tipAngleY = Math.sin(tipAngle) * outerWheelRadius;
        double leftAngleX = Math.cos(leftAngle) * (outerWheelRadius + arrowPointerSize);
        double leftAngleY = Math.sin(leftAngle) * (outerWheelRadius + arrowPointerSize);
        double rightAngleX = Math.cos(rightAngle) * (outerWheelRadius + arrowPointerSize);
        double rightAngleY = Math.sin(rightAngle) * (outerWheelRadius + arrowPointerSize);

        arrowPointerPath.reset();
        arrowPointerPath.moveTo((float) tipAngleX + centerX, (float) tipAngleY + centerY);
        arrowPointerPath.lineTo((float) leftAngleX + centerX, (float) leftAngleY + centerY);
        arrowPointerPath.lineTo((float) rightAngleX + centerX, (float) rightAngleY + centerY);
        arrowPointerPath.lineTo((float) tipAngleX + centerX, (float) tipAngleY + centerY);

        valuePointerArrowPaint.setColor(Color.HSVToColor(colorHSV));
        valuePointerArrowPaint.setStyle(Style.FILL);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

        valuePointerArrowPaint.setStyle(Style.STROKE);
        valuePointerArrowPaint.setStrokeJoin(Join.ROUND);
        valuePointerArrowPaint.setColor(Color.BLACK);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

    }
MainActivity.java 文件源码 项目:ImageEraser 阅读 20 收藏 0 点赞 0 评论 0
private void drawOnTouchMove() {
    Paint paint = new Paint();
    paint.setStrokeWidth((float) updatedBrushSize);
    paint.setColor(0);
    paint.setStyle(Style.STROKE);
    paint.setAntiAlias(true);
    paint.setStrokeJoin(Join.ROUND);
    paint.setStrokeCap(Cap.ROUND);
    paint.setXfermode(new PorterDuffXfermode(Mode.SRC));
    canvasMaster.drawPath(drawingPath, paint);
    touchImageView.invalidate();
}
MainActivity.java 文件源码 项目:ImageEraser 阅读 21 收藏 0 点赞 0 评论 0
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);
    }
}
CircularProgressBar.java 文件源码 项目:boohee_v5.6 阅读 30 收藏 0 点赞 0 评论 0
private void setupPaints() {
    this.circlePaint.setAntiAlias(true);
    this.circlePaint.setStrokeWidth((float) this.mStrokeWidth);
    this.circlePaint.setStyle(Style.STROKE);
    this.circlePaint.setColor(this.mBackgroundColor);
    this.fillPaint.setAntiAlias(true);
    this.fillPaint.setStrokeWidth((float) this.mStrokeWidth);
    this.fillPaint.setStyle(Style.STROKE);
    this.fillPaint.setStrokeJoin(Join.ROUND);
    this.fillPaint.setColor(this.mProgressColor);
    if (this.mIsCapRound) {
        this.circlePaint.setStrokeCap(Cap.ROUND);
        this.fillPaint.setStrokeCap(Cap.ROUND);
    }
}
VectorDrawableCompat.java 文件源码 项目:boohee_v5.6 阅读 31 收藏 0 点赞 0 评论 0
private Join getStrokeLineJoin(int id, Join defValue) {
    switch (id) {
        case 0:
            return Join.MITER;
        case 1:
            return Join.ROUND;
        case 2:
            return Join.BEVEL;
        default:
            return defValue;
    }
}
ColorPicker.java 文件源码 项目:ThunderMusic 阅读 38 收藏 0 点赞 0 评论 0
private void drawPointerArrow(Canvas canvas) {

        int centerX = getWidth() / 2;
        int centerY = getHeight() / 2;

        double tipAngle = (colorHSV[2] - 0.5f) * Math.PI;
        double leftAngle = tipAngle + Math.PI / 96;
        double rightAngle = tipAngle - Math.PI / 96;

        double tipAngleX = Math.cos(tipAngle) * outerWheelRadius;
        double tipAngleY = Math.sin(tipAngle) * outerWheelRadius;
        double leftAngleX = Math.cos(leftAngle)
                * (outerWheelRadius + arrowPointerSize);
        double leftAngleY = Math.sin(leftAngle)
                * (outerWheelRadius + arrowPointerSize);
        double rightAngleX = Math.cos(rightAngle)
                * (outerWheelRadius + arrowPointerSize);
        double rightAngleY = Math.sin(rightAngle)
                * (outerWheelRadius + arrowPointerSize);

        arrowPointerPath.reset();
        arrowPointerPath.moveTo((float) tipAngleX + centerX, (float) tipAngleY
                + centerY);
        arrowPointerPath.lineTo((float) leftAngleX + centerX,
                (float) leftAngleY + centerY);
        arrowPointerPath.lineTo((float) rightAngleX + centerX,
                (float) rightAngleY + centerY);
        arrowPointerPath.lineTo((float) tipAngleX + centerX, (float) tipAngleY
                + centerY);

        valuePointerArrowPaint.setColor(Color.HSVToColor(colorHSV));
        valuePointerArrowPaint.setStyle(Style.FILL);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

        valuePointerArrowPaint.setStyle(Style.STROKE);
        valuePointerArrowPaint.setStrokeJoin(Join.ROUND);
        valuePointerArrowPaint.setColor(Color.BLACK);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

    }
ColorPicker.java 文件源码 项目:controllerformote-android 阅读 23 收藏 0 点赞 0 评论 0
private void drawPointerArrow(Canvas canvas) {

        int centerX = getWidth() / 2;
        int centerY = getHeight() / 2;

        double tipAngle = (colorHSV[2] - 0.5f) * Math.PI;
        double leftAngle = tipAngle + Math.PI / 96;
        double rightAngle = tipAngle - Math.PI / 96;

        double tipAngleX = Math.cos(tipAngle) * outerWheelRadius;
        double tipAngleY = Math.sin(tipAngle) * outerWheelRadius;
        double leftAngleX = Math.cos(leftAngle) * (outerWheelRadius + arrowPointerSize);
        double leftAngleY = Math.sin(leftAngle) * (outerWheelRadius + arrowPointerSize);
        double rightAngleX = Math.cos(rightAngle) * (outerWheelRadius + arrowPointerSize);
        double rightAngleY = Math.sin(rightAngle) * (outerWheelRadius + arrowPointerSize);

        arrowPointerPath.reset();
        arrowPointerPath.moveTo((float) tipAngleX + centerX, (float) tipAngleY + centerY);
        arrowPointerPath.lineTo((float) leftAngleX + centerX, (float) leftAngleY + centerY);
        arrowPointerPath.lineTo((float) rightAngleX + centerX, (float) rightAngleY + centerY);
        arrowPointerPath.lineTo((float) tipAngleX + centerX, (float) tipAngleY + centerY);

        valuePointerArrowPaint.setColor(Color.HSVToColor(colorHSV));
        valuePointerArrowPaint.setStyle(Style.FILL);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

        valuePointerArrowPaint.setStyle(Style.STROKE);
        valuePointerArrowPaint.setStrokeJoin(Join.ROUND);
        valuePointerArrowPaint.setColor(Color.BLACK);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

    }
C0015o.java 文件源码 项目:solved-hacking-problem 阅读 22 收藏 0 点赞 0 评论 0
public C0015o() {
    this.f34a = 0;
    this.f35b = 0.0f;
    this.f36c = 0;
    this.f37d = 1.0f;
    this.f39f = 1.0f;
    this.f40g = 0.0f;
    this.f41h = 1.0f;
    this.f42i = 0.0f;
    this.f43j = Cap.BUTT;
    this.f44k = Join.MITER;
    this.f45l = 4.0f;
}
C0015o.java 文件源码 项目:solved-hacking-problem 阅读 25 收藏 0 点赞 0 评论 0
public C0015o(C0015o c0015o) {
    super(c0015o);
    this.f34a = 0;
    this.f35b = 0.0f;
    this.f36c = 0;
    this.f37d = 1.0f;
    this.f39f = 1.0f;
    this.f40g = 0.0f;
    this.f41h = 1.0f;
    this.f42i = 0.0f;
    this.f43j = Cap.BUTT;
    this.f44k = Join.MITER;
    this.f45l = 4.0f;
    this.f46p = c0015o.f46p;
    this.f34a = c0015o.f34a;
    this.f35b = c0015o.f35b;
    this.f37d = c0015o.f37d;
    this.f36c = c0015o.f36c;
    this.f38e = c0015o.f38e;
    this.f39f = c0015o.f39f;
    this.f40g = c0015o.f40g;
    this.f41h = c0015o.f41h;
    this.f42i = c0015o.f42i;
    this.f43j = c0015o.f43j;
    this.f44k = c0015o.f44k;
    this.f45l = c0015o.f45l;
}
C0015o.java 文件源码 项目:solved-hacking-problem 阅读 25 收藏 0 点赞 0 评论 0
private Join m42a(int i, Join join) {
    switch (i) {
        case C0243l.View_android_theme /*0*/:
            return Join.MITER;
        case C0243l.View_android_focusable /*1*/:
            return Join.ROUND;
        case C0243l.View_paddingStart /*2*/:
            return Join.BEVEL;
        default:
            return join;
    }
}
C0015o.java 文件源码 项目:solved-hacking-problem 阅读 20 收藏 0 点赞 0 评论 0
public C0015o() {
    this.f34a = 0;
    this.f35b = 0.0f;
    this.f36c = 0;
    this.f37d = 1.0f;
    this.f39f = 1.0f;
    this.f40g = 0.0f;
    this.f41h = 1.0f;
    this.f42i = 0.0f;
    this.f43j = Cap.BUTT;
    this.f44k = Join.MITER;
    this.f45l = 4.0f;
}
C0015o.java 文件源码 项目:solved-hacking-problem 阅读 27 收藏 0 点赞 0 评论 0
public C0015o(C0015o c0015o) {
    super(c0015o);
    this.f34a = 0;
    this.f35b = 0.0f;
    this.f36c = 0;
    this.f37d = 1.0f;
    this.f39f = 1.0f;
    this.f40g = 0.0f;
    this.f41h = 1.0f;
    this.f42i = 0.0f;
    this.f43j = Cap.BUTT;
    this.f44k = Join.MITER;
    this.f45l = 4.0f;
    this.f46p = c0015o.f46p;
    this.f34a = c0015o.f34a;
    this.f35b = c0015o.f35b;
    this.f37d = c0015o.f37d;
    this.f36c = c0015o.f36c;
    this.f38e = c0015o.f38e;
    this.f39f = c0015o.f39f;
    this.f40g = c0015o.f40g;
    this.f41h = c0015o.f41h;
    this.f42i = c0015o.f42i;
    this.f43j = c0015o.f43j;
    this.f44k = c0015o.f44k;
    this.f45l = c0015o.f45l;
}
C0015o.java 文件源码 项目:solved-hacking-problem 阅读 24 收藏 0 点赞 0 评论 0
private Join m42a(int i, Join join) {
    switch (i) {
        case C0243l.View_android_theme /*0*/:
            return Join.MITER;
        case C0243l.View_android_focusable /*1*/:
            return Join.ROUND;
        case C0243l.View_paddingStart /*2*/:
            return Join.BEVEL;
        default:
            return join;
    }
}
ColorPicker.java 文件源码 项目:px-android 阅读 35 收藏 0 点赞 0 评论 0
private void drawPointerArrow(Canvas canvas) {

        int centerX = getWidth() / 2;
        int centerY = getHeight() / 2;

        double tipAngle = (colorHSV[2] - 0.5f) * Math.PI;
        double leftAngle = tipAngle + Math.PI / 96;
        double rightAngle = tipAngle - Math.PI / 96;

        double tipAngleX = Math.cos(tipAngle) * outerWheelRadius;
        double tipAngleY = Math.sin(tipAngle) * outerWheelRadius;
        double leftAngleX = Math.cos(leftAngle) * (outerWheelRadius + arrowPointerSize);
        double leftAngleY = Math.sin(leftAngle) * (outerWheelRadius + arrowPointerSize);
        double rightAngleX = Math.cos(rightAngle) * (outerWheelRadius + arrowPointerSize);
        double rightAngleY = Math.sin(rightAngle) * (outerWheelRadius + arrowPointerSize);

        arrowPointerPath.reset();
        arrowPointerPath.moveTo((float) tipAngleX + centerX, (float) tipAngleY + centerY);
        arrowPointerPath.lineTo((float) leftAngleX + centerX, (float) leftAngleY + centerY);
        arrowPointerPath.lineTo((float) rightAngleX + centerX, (float) rightAngleY + centerY);
        arrowPointerPath.lineTo((float) tipAngleX + centerX, (float) tipAngleY + centerY);

        valuePointerArrowPaint.setColor(Color.HSVToColor(colorHSV));
        valuePointerArrowPaint.setStyle(Style.FILL);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

        valuePointerArrowPaint.setStyle(Style.STROKE);
        valuePointerArrowPaint.setStrokeJoin(Join.ROUND);
        valuePointerArrowPaint.setColor(Color.BLACK);
        canvas.drawPath(arrowPointerPath, valuePointerArrowPaint);

    }


问题


面经


文章

微信
公众号

扫码关注公众号