How to draw Bezier Curve in Android
public class DrawView extends View {
Paint paint;
Path path;
public DrawView(Context context) {
super(context);
init();
}
public DrawView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public DrawView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
private void init(){
paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
}
@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
super.onDraw(canvas);
path = new Path();
paint.setColor(Color.RED);
paint.setStrokeWidth(3);
path.moveTo(34, 259);
path.cubicTo(68, 151, 286, 350, 336, 252);
canvas.drawPath(path, paint);
}
Also in Java:
- java stack
- how to create a java jframe
- threadsafe singleton pattern in java
- java tester si un caractere est une lettre
- eliminar fila jtable java
- for each java
- adding an element to the end of a linked list java
- How to draw Bezier Curve in Android
- Manifest merger failed androidx
- how to minimize jframe in java
- java shortest if else statement
- how to create gravity in java
- how to open a text file in java
- spark write partitionby
- java split array into two
- java initialize int array
- countdown timer with seekbar
- check if string is decimal java
- bootstrap center text vertically
- hashmap in java
- print arraylist java
- change the value in a hashtable java
- how to print something in java
- how to compare two maps in java