Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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);

    }
Comment

PREVIOUS NEXT
Code Example
Java :: java iterate hashmap 
Java :: java substring after last char 
Java :: map initialization java 
Java :: Access items from the ArrayList using get() function 
Java :: processing angle between two points 
Java :: is a and has a relationship in java 
Java :: method resolve file in java 
Java :: java standard exceptions 
Java :: java make a null string 
Java :: java random double between 0 and 1 
Java :: how to reverse a number in java 
Java :: how to add a list in a list java 
Java :: how to add string to array in java 
Java :: esponente in java 
Java :: kubectl config kubernetes dashboard 
Java :: set layout params in dp value 
Java :: linear search algorithm java 
Java :: How to efficiently reverse a singly linked list, in Java? 
Java :: java if statement 
Java :: how to turna date into a LocalDateTime java 
Java :: java base64 to file 
Java :: java 2 decimals 
Java :: java command to start jenkins 
Java :: java ignore catch 
Java :: setting java home 
Java :: haxe interface 
Java :: minimum and maximum in array in java 
Java :: findone in spring boot 2.4.1 
Java :: insert data from database sqlite android 
Java :: scala vs java 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =