How to display stitch on screen without using canvas

Asked

Viewed 13 times

0

I created an application in Java to draw lines, when I click the first time it draws a point to symbolize where it was clicked and when I click the second time it draws a straight line from the first point, until it was clicked. My question is how do I show this point without drawing it? Because when I change the alpha of my brush this point becomes visible.

My code so far is this

 if(event.getAction() == MotionEvent.ACTION_DOWN){
                if(sf){
                    xs = x;
                    ys = y;
                    paint.setStrokeWidth(sz/2);
                    canvas.drawPoint(x , y, paint);
                    sf = false;
                }else{
                    xf = x;
                    yf = y;
                    paint.setStrokeWidth(sz);
                    canvas.drawLine(xs, ys, xf, yf, paint);
                    sf = true;
                }
            }
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.