Draw rounded corner line along path, with CornerPathEffect.

Draw rounded corner line along path, with CornerPathEffect.

Draw rounded corner line along path, with CornerPathEffect. - Hallo sahabat Teknologi Terbaru, Pada Artikel yang anda baca kali ini dengan judul Draw rounded corner line along path, with CornerPathEffect., kami telah mempersiapkan artikel ini dengan baik untuk anda baca dan ambil informasi didalamnya. mudah-mudahan isi postingan yang kami tulis ini dapat anda pahami. baiklah, selamat membaca.

Judul : Draw rounded corner line along path, with CornerPathEffect.
link : Draw rounded corner line along path, with CornerPathEffect.

Baca juga


Draw rounded corner line along path, with CornerPathEffect.

Example to draw rounded corner line along path, by applying CornerPathEffect on path.


Modify MyView.java from the post.
package com.example.androidview;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.CornerPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.View;

public class MyView extends View {

Paint paint;
Path path;

public MyView(Context context) {
super(context);
init();
}

public MyView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}

public MyView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}

private void init() {
paint = new Paint();
paint.setColor(Color.BLUE);
paint.setStrokeWidth(10);
paint.setStyle(Paint.Style.STROKE);

path = new Path();
path.moveTo(50, 50);
path.lineTo(50, 500);
path.lineTo(200, 500);
path.lineTo(200, 300);
path.lineTo(350, 300);

float radius = 50.0f;

CornerPathEffect cornerPathEffect =
new CornerPathEffect(radius);

paint.setPathEffect(cornerPathEffect);

}

@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawPath(path, paint);

}

}



Demikianlah Artikel Draw rounded corner line along path, with CornerPathEffect.

Sekianlah artikel Draw rounded corner line along path, with CornerPathEffect. kali ini, mudah-mudahan bisa memberi manfaat untuk anda semua. baiklah, sampai jumpa di postingan artikel lainnya.


0 Response to "Draw rounded corner line along path, with CornerPathEffect."

Post a Comment