user648144
user648144

Reputation:

Drawing polygon and fill it

what I like to do is to draw a polygon and when it's completed I want to fill the polygon with a translucent color.

I'm able to draw a polygon by using canvas.drawLine(...), but can't fill it.

I know in java-awt it's easy, but I can't find it in Android.

Any help is appreciated.

Thanx.

Upvotes: 1

Views: 5812

Answers (1)

Muhammad Zeeshan
Muhammad Zeeshan

Reputation: 8856

You have to do something like this

Paint paint = new Paint();
paint.setStyle(Paint.Style.FILL);

And draw

yourCanvas.drawPath(path,mPaint);

For details you can check PAINT and PATH

Upvotes: 7

Related Questions