Skip to content

This is a project in which I am trying to implement a painter for android stdio. Initially I will draw a single line in a layout, gradually circle, oval, square, rectangle will be added.

Notifications You must be signed in to change notification settings

atiqahammed/Draw

Repository files navigation

Android-Paint

Drawing on touch

Initially I was trying to implement some functionality with which I could drow something touching the screen. Following code helped me i that case.

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        currentXCoordinate = event.getX();
        currentYCoordinate = event.getY();
        float radious  = (float) 30.0;
        
        canvas.drawCircle(currentXCoordinate, currentYCoordinate, radious, paint);
        LinearLayout l1 = (LinearLayout)findViewById(R.id.drawarea);
        l1.setBackgroundDrawable(new BitmapDrawable(myBitMap));
        return super.onTouchEvent(event);
    }

About

This is a project in which I am trying to implement a painter for android stdio. Initially I will draw a single line in a layout, gradually circle, oval, square, rectangle will be added.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages