athlon
athlon

Reputation: 45

Android canvas hidden shape

I am making a small app that requires drawing some rectangle and using its contains() method. My problem is to draw a hidden rectangle. I'm trying to use Paint's setStyle(Paint.Style.STROKE), then setStrokeWidth(0). But the stroke is still visible.

Upvotes: 0

Views: 446

Answers (1)

Raghunandan
Raghunandan

Reputation: 133560

Set your paint color to transparent color. try the below

    Paint paint = new Paint();
    paint.setColor(0xFF);

            OR

    paint.setColor(Color.TRANSPARENT);

    canvas.drawRect(30, 30, 80, 80, paint);

Upvotes: 1

Related Questions