0

I am devolping an android app where in a user can paint using touch screen. I have created my custom class where in I am overriding ondraw() and implemented on touch listener the code looks like this

@Override
protected void onDraw(Canvas canvas){
canvas.drawBitmap(canvasBitmap, 0, 0,canvasPaint);
canvas.drawPath(drawPath, drawPaint);
}

 //register user touches as drawing action
@Override
public boolean onTouchEvent(MotionEvent event)
{
float touchX=event.getX();
float touchY=event.getY();
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
    drawPath.moveTo(touchX, touchY);

    break;
case MotionEvent.ACTION_MOVE:
    drawPath.lineTo(touchX, touchY);

    break;
case MotionEvent.ACTION_UP:
    drawCanvas.drawPath(drawPath,drawPaint);
    drawPath.reset();

    break;

default:
    return false;
}
invalidate();
return true;
}

Every thing working fine but now I want to check continuously the drawing area to see if all the pixel are colored but not white and when all pixels are colored I would like to give message to user how do I do it I am stuck.. Please help

user3048027
  • 387
  • 1
  • 5
  • 24
  • No its not duplicate that is a imageview and I have made my own class and I tried to use that code but that didn't work – user3048027 Feb 03 '14 at 14:06
  • Sorry but maybe you didn't understand the code on the other question answer, your custom class extends ImageView? If not, things can get a little different, if you want more help try to share more of your code, so we can test and try to find a solution together – GhostDerfel Feb 03 '14 at 14:11
  • No my custom class extends view ... How do I share more do I need to edit my post – user3048027 Feb 04 '14 at 05:26

0 Answers0