title: Android: How to fill color to the specific part of the Image only?
body: <p>I have Image Like this:</p>
  
  <p><img src="https://i.stack.imgur.com/Y10kl.jpg" alt="enter image description here">
  Now, i want to fill the color to the Specific part of that image. as like If i select color blue and if i touch on Cap then the cap should be fill with the color Blue. Same thing should be also happen with the other part like nose, Mouth, Eyes etc</p>
  
  <p>So, How it is possible using android ?</p>
  
  <p>Can any budy help me please.</p>
  
  <p><strong>Updated</strong></p>
  
  <p>I have try with the implementation of the FloodFill algorithm in my app. <a href="http://pastebin.com/W1BEpxaF" rel="noreferrer">See Here</a></p>
  
  <p>But after doing that i got exception like:</p>
  
  <pre><code>    03-09 17:45:16.260: ERROR/AndroidRuntime(2558): java.lang.IllegalStateException
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at android.graphics.Bitmap.setPixel(Bitmap.java:847)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at com.project.fingerpaint.FinderPaintDemo.FloodFill(FinderPaintDemo.java:284)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at com.project.fingerpaint.FinderPaintDemo.access$3(FinderPaintDemo.java:272)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at com.project.fingerpaint.FinderPaintDemo$MyView.onTouchEvent(FinderPaintDemo.java:187)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at android.view.View.dispatchTouchEvent(View.java:3766)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at android.os.Handler.dispatchMessage(Handler.java:99)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at android.os.Looper.loop(Looper.java:123)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at java.lang.reflect.Method.invokeNative(Native Method)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at java.lang.reflect.Method.invoke(Method.java:521)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  03-09 17:45:16.260: ERROR/AndroidRuntime(2558):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Now, What wrong in my code ??</p>
  
  <p>Please help me in that condition.</p>
  
  <p>Thanks.</p>