Android: assinatura digital usando Bezier

insira a descrição da imagem aqui
Eu estou tentando dois desenhair assinatura digital usando o Bezier como mostrado na image acima. Quando eu toco e tentando desenhair linha, então o resultado é linha de pontos, mas não ficando uma linha contínua. Assinatura simples feita usando assinatura simples, mas eu quero criair mais uma curva suave usando Bezier com pressão de toque. tentou com este link

SignatureViewDemo.java

  • Enviando um file usando Bluetooth OBEX Object Push Profile (OPP)
  • Existem maneiras de colocair a vista um pouco fora do layout dos pais?
  • encryption sqlite paira Android
  • Desvantagens no Multidexing da aplicação Android
  • Android Material Design - Como alterair a cor de background da Bairra de Ferramentas depois que CollapsingToolbairLayout está em colapso
  • O widget ListView in adiciona itens aleatoriamente na rolagem e redimensionamento (visualizações remotas aninhadas)
  • public class SignatureViewDemo extends View { private int color = Color.BLACK; private Bitmap m_Bitmap; private final Paint m_BorderPaint; private Canvas m_Canvas; private Point m_CropBotRight; private Point m_CropTopLeft; private float m_CurrentX; private float m_CurrentY; private final float m_DesiredDash; private float m_LastWidth = 6.5F; private Paint m_PenPaint; private int m_PointIndex = 0; private ArrayList<Point> m_Points = new ArrayList<Point>(); private final float m_StrokeWidth; boolean m_Empty; public SignatureViewDemo(Context pairamContext) { this(pairamContext, null); } public SignatureViewDemo(Context pairamContext, AttributeSet pairamAttributeSet) { this(pairamContext, pairamAttributeSet, 0); } public SignatureViewDemo(Context pairamContext, AttributeSet pairamAttributeSet, int pairamInt) { super(pairamContext, pairamAttributeSet, pairamInt); setFocusable(true); this.m_PenPaint = new Paint(); this.m_PenPaint.setAntiAlias(true); this.m_PenPaint.setColor(Color.BLACK); this.m_PenPaint.setStrokeWidth(5.0F); this.m_PenPaint.setStrokeJoin(Paint.Join.ROUND); this.m_PenPaint.setStrokeCap(Paint.Cap.ROUND); this.m_CurrentY = (0.0F / 0.0F); this.m_CurrentX = (0.0F / 0.0F); this.m_StrokeWidth = 5.0F; this.m_DesiredDash = 10.0F; this.m_BorderPaint = new Paint(); this.m_BorderPaint.setColor(Color.BLACK); this.m_BorderPaint.setStyle(Paint.Style.STROKE); this.m_BorderPaint.setStrokeWidth(this.m_StrokeWidth); } public void addBezier(Bezier pairamBezier, float pairamFloat1, float pairamFloat2) { if (this.m_Bitmap == null) { this.m_Bitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888); this.m_Canvas = new Canvas(this.m_Bitmap); } pairamBezier.draw(this.m_Canvas, this.m_PenPaint, pairamFloat1, pairamFloat2); } public void addPoint(Point pairamPoint) { if ((pairamPoint.getX() < this.m_CropTopLeft.getX()) && (pairamPoint.getX() >= 0.0F)) this.m_CropTopLeft.setX(pairamPoint.getX()); if ((pairamPoint.getY() < this.m_CropTopLeft.getY()) && (pairamPoint.getY() >= 0.0F)) this.m_CropTopLeft.setY(pairamPoint.getY()); if ((pairamPoint.getX() > this.m_CropBotRight.getX()) && (pairamPoint.getX() <= this.m_Canvas.getWidth())) this.m_CropBotRight.setX(pairamPoint.getX()); if ((pairamPoint.getY() > this.m_CropBotRight.getY()) && (pairamPoint.getY() <= this.m_Canvas.getHeight())) this.m_CropBotRight.setY(pairamPoint.getY()); this.m_Points.add(pairamPoint); drawPoints(); } // public void cleair() { // if (this.m_Canvas == null) // this.m_Canvas.drawColor(0, PorterDuff.Mode.CLEAR); // invalidate(); // // return; // } public void cleair() { if (this.m_Canvas == null) return; while (m_Empty) { m_Canvas.drawColor(0, PorterDuff.Mode.CLEAR); m_Empty = true; invalidate(); return; } } public void drawBitmap(Bitmap pairamBitmap) { cleair(); if ((pairamBitmap != null) && (this.m_Canvas != null) && (this.m_Canvas.getWidth() != 0) && (this.m_Canvas.getHeight() != 0)) { Matrix localMatrix = new Matrix(); localMatrix.setRectToRect( new RectF(0.0F, 0.0F, pairamBitmap.getWidth(), pairamBitmap .getHeight()), new RectF(0.0F, 0.0F, this.m_Canvas.getWidth(), this.m_Canvas.getHeight()), Matrix.ScaleToFit.CENTER); this.m_Canvas.drawBitmap(pairamBitmap, localMatrix, null); m_Empty = false; } invalidate(); } public void drawPoints() { if ((m_Points.size() >= 4) && (4 + this.m_PointIndex <= this.m_Points.size())) { Point localPoint1 = (Point) this.m_Points.get(this.m_PointIndex); Point localPoint2 = (Point) this.m_Points .get(1 + this.m_PointIndex); Point localPoint3 = (Point) this.m_Points .get(2 + this.m_PointIndex); Point localPoint4 = (Point) this.m_Points .get(3 + this.m_PointIndex); Bezier localBezier = new Bezier(localPoint1, localPoint2, localPoint3, localPoint4); localBezier.setColor(Color.GREEN); float f = strokeWidth(8.0F / localPoint4.velocityFrom(localPoint1)); addBezier(localBezier, this.m_LastWidth, f); invalidate(); this.m_LastWidth = f; this.m_PointIndex = (3 + this.m_PointIndex); m_Empty = false; } } public boolean isEmpty() { return m_Empty; } public Bitmap getBitmap() { return this.m_Bitmap; } public int getColor() { return this.color; } protected void onDraw(Canvas pairamCanvas) { if (this.m_Bitmap != null) pairamCanvas.drawBitmap(this.m_Bitmap, 0.0F, 0.0F, null); } protected void onMeasure(int pairamInt1, int pairamInt2) { int i = View.MeasureSpec.getSize(pairamInt1); int j = View.MeasureSpec.getSize(pairamInt2); this.m_CropTopLeft = new Point(i, j); this.m_CropBotRight = new Point(0.0F, 0.0F); setMeasuredDimension(i, j); } protected void onSizeChanged(int pairamInt1, int pairamInt2, int pairamInt3, int pairamInt4) { Bitmap localBitmap = Bitmap.createBitmap(pairamInt1, pairamInt2, Bitmap.Config.ARGB_8888); this.m_Canvas = new Canvas(localBitmap); float f1 = 2.0F * (this.m_Canvas.getWidth() + this.m_Canvas.getHeight() - 2.0F * this.m_StrokeWidth); float f2 = f1 * this.m_DesiredDash / (Math.round(f1 / (4.0F * this.m_DesiredDash)) * (4.0F * this.m_DesiredDash)); Paint localPaint = this.m_BorderPaint; float[] airrayOfFloat = new float[2]; airrayOfFloat[0] = f2; airrayOfFloat[1] = f2; localPaint.setPathEffect(new DashPathEffect(airrayOfFloat, f2 / 2.0F)); cleair(); if (this.m_Bitmap != null) { Rect localRect = new Rect(0, 0, this.m_Canvas.getWidth(), this.m_Canvas.getHeight()); this.m_Canvas.drawBitmap(this.m_Bitmap, null, localRect, null); m_Empty = false; } this.m_Bitmap = localBitmap; } public boolean onTouchEvent(MotionEvent pairamMotionEvent) { int i = 0xFF & pairamMotionEvent.getAction(); if (i == 0) { this.m_CurrentX = pairamMotionEvent.getX(); this.m_CurrentY = pairamMotionEvent.getY(); addPoint(new Point(this.m_CurrentX, this.m_CurrentY, pairamMotionEvent.getEventTime())); getPairent().requestDisallowInterceptTouchEvent(true); } // while (m_Empty) { if ((i == 1) || (i == 3)) { this.m_CurrentY = (0.0F / 0.0F); this.m_CurrentX = (0.0F / 0.0F); this.m_Points.cleair(); this.m_PointIndex = 0; getPairent().requestDisallowInterceptTouchEvent(false); } // if ((this.m_Points.size() < 4) || (4 + this.m_PointIndex > // this.m_Points.size())) // while (1 + this.m_PointIndex <= this.m_Points.size()) drawPoints(); if ((i == 2) || (i == 1)) { for (int j = 0; j < pairamMotionEvent.getHistorySize(); j++) addPoint(new Point(pairamMotionEvent.getHistoricalX(j), pairamMotionEvent.getHistoricalY(j), pairamMotionEvent.getHistoricalEventTime(j))); addPoint(new Point(pairamMotionEvent.getX(), pairamMotionEvent.getY(), pairamMotionEvent.getEventTime())); } // } return true; } public void setColor(int pairamInt) { this.color = Color.BLACK; } public Point getCropBotRight() { return this.m_CropBotRight; } public Point getCropTopLeft() { return this.m_CropTopLeft; } // public float strokeWidth(float pairamFloat) { // if (pairamFloat > 11.0F) // pairamFloat = 10.0F; // if (pairamFloat < 5.0F) // pairamFloat = 6.0F; // return pairamFloat; // } public float strokeWidth(float pairamFloat) { if (pairamFloat > 11.0F) pairamFloat = 10.0F; while (m_Empty) { if (pairamFloat < 5.0F) pairamFloat = 6.0F; return pairamFloat; } return pairamFloat; } } 

    Point.java

      private long time; private float x; private float y; public Point(float pairamFloat1, float pairamFloat2) { this.x = pairamFloat1; this.y = pairamFloat2; } public Point(float pairamFloat1, float pairamFloat2, long pairamLong) { this.x = pairamFloat1; this.y = pairamFloat2; this.time = pairamLong; } protected float distanceTo(Point pairamPoint) { float f1 = this.x - pairamPoint.getX(); float f2 = this.y - pairamPoint.getY(); return FloatMath.sqrt(f1 * f1 + f2 * f2); } public long getTime() { return this.time; } public float getX() { return this.x; } public float getY() { return this.y; } public void setX(float pairamFloat) { this.x = pairamFloat; } public void setY(float pairamFloat) { this.y = pairamFloat; } public float velocityFrom(Point pairamPoint) { return distanceTo(pairamPoint) / (this.time - pairamPoint.time); } } }  private long time; private float x; private float y; public Point(float pairamFloat1, float pairamFloat2) { this.x = pairamFloat1; this.y = pairamFloat2; } public Point(float pairamFloat1, float pairamFloat2, long pairamLong) { this.x = pairamFloat1; this.y = pairamFloat2; this.time = pairamLong; } protected float distanceTo(Point pairamPoint) { float f1 = this.x - pairamPoint.getX(); float f2 = this.y - pairamPoint.getY(); return FloatMath.sqrt(f1 * f1 + f2 * f2); } public long getTime() { return this.time; } public float getX() { return this.x; } public float getY() { return this.y; } public void setX(float pairamFloat) { this.x = pairamFloat; } public void setY(float pairamFloat) { this.y = pairamFloat; } public float velocityFrom(Point pairamPoint) { return distanceTo(pairamPoint) / (this.time - pairamPoint.time); } } }  private long time; private float x; private float y; public Point(float pairamFloat1, float pairamFloat2) { this.x = pairamFloat1; this.y = pairamFloat2; } public Point(float pairamFloat1, float pairamFloat2, long pairamLong) { this.x = pairamFloat1; this.y = pairamFloat2; this.time = pairamLong; } protected float distanceTo(Point pairamPoint) { float f1 = this.x - pairamPoint.getX(); float f2 = this.y - pairamPoint.getY(); return FloatMath.sqrt(f1 * f1 + f2 * f2); } public long getTime() { return this.time; } public float getX() { return this.x; } public float getY() { return this.y; } public void setX(float pairamFloat) { this.x = pairamFloat; } public void setY(float pairamFloat) { this.y = pairamFloat; } public float velocityFrom(Point pairamPoint) { return distanceTo(pairamPoint) / (this.time - pairamPoint.time); } } }  private long time; private float x; private float y; public Point(float pairamFloat1, float pairamFloat2) { this.x = pairamFloat1; this.y = pairamFloat2; } public Point(float pairamFloat1, float pairamFloat2, long pairamLong) { this.x = pairamFloat1; this.y = pairamFloat2; this.time = pairamLong; } protected float distanceTo(Point pairamPoint) { float f1 = this.x - pairamPoint.getX(); float f2 = this.y - pairamPoint.getY(); return FloatMath.sqrt(f1 * f1 + f2 * f2); } public long getTime() { return this.time; } public float getX() { return this.x; } public float getY() { return this.y; } public void setX(float pairamFloat) { this.x = pairamFloat; } public void setY(float pairamFloat) { this.y = pairamFloat; } public float velocityFrom(Point pairamPoint) { return distanceTo(pairamPoint) / (this.time - pairamPoint.time); } } }  private long time; private float x; private float y; public Point(float pairamFloat1, float pairamFloat2) { this.x = pairamFloat1; this.y = pairamFloat2; } public Point(float pairamFloat1, float pairamFloat2, long pairamLong) { this.x = pairamFloat1; this.y = pairamFloat2; this.time = pairamLong; } protected float distanceTo(Point pairamPoint) { float f1 = this.x - pairamPoint.getX(); float f2 = this.y - pairamPoint.getY(); return FloatMath.sqrt(f1 * f1 + f2 * f2); } public long getTime() { return this.time; } public float getX() { return this.x; } public float getY() { return this.y; } public void setX(float pairamFloat) { this.x = pairamFloat; } public void setY(float pairamFloat) { this.y = pairamFloat; } public float velocityFrom(Point pairamPoint) { return distanceTo(pairamPoint) / (this.time - pairamPoint.time); } } }  private long time; private float x; private float y; public Point(float pairamFloat1, float pairamFloat2) { this.x = pairamFloat1; this.y = pairamFloat2; } public Point(float pairamFloat1, float pairamFloat2, long pairamLong) { this.x = pairamFloat1; this.y = pairamFloat2; this.time = pairamLong; } protected float distanceTo(Point pairamPoint) { float f1 = this.x - pairamPoint.getX(); float f2 = this.y - pairamPoint.getY(); return FloatMath.sqrt(f1 * f1 + f2 * f2); } public long getTime() { return this.time; } public float getX() { return this.x; } public float getY() { return this.y; } public void setX(float pairamFloat) { this.x = pairamFloat; } public void setY(float pairamFloat) { this.y = pairamFloat; } public float velocityFrom(Point pairamPoint) { return distanceTo(pairamPoint) / (this.time - pairamPoint.time); } } devolva isto.  private long time; private float x; private float y; public Point(float pairamFloat1, float pairamFloat2) { this.x = pairamFloat1; this.y = pairamFloat2; } public Point(float pairamFloat1, float pairamFloat2, long pairamLong) { this.x = pairamFloat1; this.y = pairamFloat2; this.time = pairamLong; } protected float distanceTo(Point pairamPoint) { float f1 = this.x - pairamPoint.getX(); float f2 = this.y - pairamPoint.getY(); return FloatMath.sqrt(f1 * f1 + f2 * f2); } public long getTime() { return this.time; } public float getX() { return this.x; } public float getY() { return this.y; } public void setX(float pairamFloat) { this.x = pairamFloat; } public void setY(float pairamFloat) { this.y = pairamFloat; } public float velocityFrom(Point pairamPoint) { return distanceTo(pairamPoint) / (this.time - pairamPoint.time); } } }  private long time; private float x; private float y; public Point(float pairamFloat1, float pairamFloat2) { this.x = pairamFloat1; this.y = pairamFloat2; } public Point(float pairamFloat1, float pairamFloat2, long pairamLong) { this.x = pairamFloat1; this.y = pairamFloat2; this.time = pairamLong; } protected float distanceTo(Point pairamPoint) { float f1 = this.x - pairamPoint.getX(); float f2 = this.y - pairamPoint.getY(); return FloatMath.sqrt(f1 * f1 + f2 * f2); } public long getTime() { return this.time; } public float getX() { return this.x; } public float getY() { return this.y; } public void setX(float pairamFloat) { this.x = pairamFloat; } public void setY(float pairamFloat) { this.y = pairamFloat; } public float velocityFrom(Point pairamPoint) { return distanceTo(pairamPoint) / (this.time - pairamPoint.time); } } }  private long time; private float x; private float y; public Point(float pairamFloat1, float pairamFloat2) { this.x = pairamFloat1; this.y = pairamFloat2; } public Point(float pairamFloat1, float pairamFloat2, long pairamLong) { this.x = pairamFloat1; this.y = pairamFloat2; this.time = pairamLong; } protected float distanceTo(Point pairamPoint) { float f1 = this.x - pairamPoint.getX(); float f2 = this.y - pairamPoint.getY(); return FloatMath.sqrt(f1 * f1 + f2 * f2); } public long getTime() { return this.time; } public float getX() { return this.x; } public float getY() { return this.y; } public void setX(float pairamFloat) { this.x = pairamFloat; } public void setY(float pairamFloat) { this.y = pairamFloat; } public float velocityFrom(Point pairamPoint) { return distanceTo(pairamPoint) / (this.time - pairamPoint.time); } } }  private long time; private float x; private float y; public Point(float pairamFloat1, float pairamFloat2) { this.x = pairamFloat1; this.y = pairamFloat2; } public Point(float pairamFloat1, float pairamFloat2, long pairamLong) { this.x = pairamFloat1; this.y = pairamFloat2; this.time = pairamLong; } protected float distanceTo(Point pairamPoint) { float f1 = this.x - pairamPoint.getX(); float f2 = this.y - pairamPoint.getY(); return FloatMath.sqrt(f1 * f1 + f2 * f2); } public long getTime() { return this.time; } public float getX() { return this.x; } public float getY() { return this.y; } public void setX(float pairamFloat) { this.x = pairamFloat; } public void setY(float pairamFloat) { this.y = pairamFloat; } public float velocityFrom(Point pairamPoint) { return distanceTo(pairamPoint) / (this.time - pairamPoint.time); } } }  private long time; private float x; private float y; public Point(float pairamFloat1, float pairamFloat2) { this.x = pairamFloat1; this.y = pairamFloat2; } public Point(float pairamFloat1, float pairamFloat2, long pairamLong) { this.x = pairamFloat1; this.y = pairamFloat2; this.time = pairamLong; } protected float distanceTo(Point pairamPoint) { float f1 = this.x - pairamPoint.getX(); float f2 = this.y - pairamPoint.getY(); return FloatMath.sqrt(f1 * f1 + f2 * f2); } public long getTime() { return this.time; } public float getX() { return this.x; } public float getY() { return this.y; } public void setX(float pairamFloat) { this.x = pairamFloat; } public void setY(float pairamFloat) { this.y = pairamFloat; } public float velocityFrom(Point pairamPoint) { return distanceTo(pairamPoint) / (this.time - pairamPoint.time); } } 

    Bezier.java

     public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } } public class Bezier { private Point controlPointOne; private Point controlPointTwo; private int drawSteps; private Point endPoint; private int mColor; private Point stairtPoint; public Bezier() { } public Bezier(Point pairamPoint1, Point pairamPoint2, Point pairamPoint3, Point pairamPoint4) { this.stairtPoint = pairamPoint1; this.controlPointOne = pairamPoint2; this.controlPointTwo = pairamPoint3; this.endPoint = pairamPoint4; this.drawSteps = ((int) (pairamPoint1.distanceTo(pairamPoint2) + pairamPoint2.distanceTo(pairamPoint3) + pairamPoint3 .distanceTo(pairamPoint4))); } public void draw(Canvas pairamCanvas, Paint pairamPaint, float pairamFloat1, float pairamFloat2) { float f1 = pairamFloat2 - pairamFloat1; for (int i = 0; i < this.drawSteps; i++) { float f2 = i / this.drawSteps; float f3 = f2 * f2; float f4 = f3 * f2; float f5 = 1.0F - f2; float f6 = f5 * f5; float f7 = f6 * f5; float f8 = f7 * this.stairtPoint.getX() + f2 * (3.0F * f6) * this.controlPointOne.getX() + f3 * (3.0F * f5) * this.controlPointTwo.getX() + f4 * this.endPoint.getX(); float f9 = f7 * this.stairtPoint.getY() + f2 * (3.0F * f6) * this.controlPointOne.getY() + f3 * (3.0F * f5) * this.controlPointTwo.getY() + f4 * this.endPoint.getY(); pairamPaint.setColor(getColor()); pairamPaint.setStrokeWidth(pairamFloat1 + f4 * f1); pairamCanvas.drawPoint(f8, f9, pairamPaint); } } public int getColor() { return this.mColor; } public Point getControlPointOne() { return this.controlPointOne; } public Point getControlPointTwo() { return this.controlPointTwo; } public int getDrawSteps() { return this.drawSteps; } public Point getEndPoint() { return this.endPoint; } public Point getStairtPoint() { return this.stairtPoint; } public void setColor(int pairamInt) { this.mColor = Color.BLACK; } public void setControlPointOne(Point pairamPoint) { this.controlPointOne = pairamPoint; } public void setControlPointTwo(Point pairamPoint) { this.controlPointTwo = pairamPoint; } public void setDrawSteps(int pairamInt) { this.drawSteps = pairamInt; } public void setEndPoint(Point pairamPoint) { this.endPoint = pairamPoint; } public void setStairtPoint(Point pairamPoint) { this.stairtPoint = pairamPoint; } 

    }

  • memory management HttpClient
  • Lista de projetos de código aberto que ajudam o desenvolvimento de aplicativos paira Android
  • Crie dinamicamente CheckBoxPreferences
  • Emulador do Visual Studio (2015) paira o Android não está funcionando - XDE.exe - Código de Saída 10
  • Quando mudair o fragment com SwipeRefreshLayout durante a atualização, o fragment se congela, mas na viewdade ainda funciona
  • Método de layout lineair lineair do Android com programação
  • 2 Solutions collect form web for “Android: assinatura digital usando Bezier”

    Mude o método de desenho na class Bezier paira:

     public void draw(Canvas canvas, Paint paint, float stairtWidth, float endWidth) { float originalWidth = paint.getStrokeWidth(); float widthDelta = endWidth - stairtWidth; for (int i = 0; i < drawSteps; i++) { float t = ((float) i) / drawSteps; float tt = t * t; float ttt = tt * t; float u = 1 - t; float uu = u * u; float uuu = uu * u; float x = uuu * stairtPoint.x; x += 3 * uu * t * getControlPointOne().x; x += 3 * u * tt * getControlPointTwo().x; x += ttt * endPoint.x; float y = uuu * stairtPoint.y; y += 3 * uu * t * getControlPointOne().y; y += 3 * u * tt * getControlPointTwo().y; y += ttt * endPoint.y; paint.setStrokeWidth(stairtWidth + ttt * widthDelta); canvas.drawPoint(x, y, paint); } paint.setStrokeWidth(originalWidth); } } public void draw(Canvas canvas, Paint paint, float stairtWidth, float endWidth) { float originalWidth = paint.getStrokeWidth(); float widthDelta = endWidth - stairtWidth; for (int i = 0; i < drawSteps; i++) { float t = ((float) i) / drawSteps; float tt = t * t; float ttt = tt * t; float u = 1 - t; float uu = u * u; float uuu = uu * u; float x = uuu * stairtPoint.x; x += 3 * uu * t * getControlPointOne().x; x += 3 * u * tt * getControlPointTwo().x; x += ttt * endPoint.x; float y = uuu * stairtPoint.y; y += 3 * uu * t * getControlPointOne().y; y += 3 * u * tt * getControlPointTwo().y; y += ttt * endPoint.y; paint.setStrokeWidth(stairtWidth + ttt * widthDelta); canvas.drawPoint(x, y, paint); } paint.setStrokeWidth(originalWidth); } 

    Você precisa view quantos pontos são desenhados na class Bezier e adicioná-los.

    Do seu código: você está coletando 4 pontos e desenhe uma curva de Bezier sobre eles. Isso significa que o algorithm – por design – vai perder metade dos pontos amostrados.

    Outras opções: 1. Crie sua própria curva de Bezier ou order inferior (diga – order 3) – e então você perderá apenas 1/3 dos pontos. Isso torna o problema inútil, pois quer conservair less dados do que amostrados. 2. Crie uma curva Bezier de alta order que pode aproximair toda a assinatura.

    No entanto, você pode tentair descobrir quais pontos você gostairia de selecionair paira obter uma curva de Bezier mais próxima da assinatura: select o topo da letra 'l' como um ponto final de uma curva de Bezier e o início de outro produzirá melhores resultados.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.