how to get bitmap from custom RadioButton ontouch?
<p>I am using custom RadioButton, where i need to make clickable only on the image visible area. As you can see in the image below , where I need to make clickable only on the image portion ie White and Green portion only, the black area will remain transparent and non clickable. </p>

<p><img src="http://i.stack.imgur.com/nSrv1.png" alt="enter image description here"></p>

<p>I have tried to get the bitmap that i am using in the custom RadioButton, through which I'll be able to get the alpha where touched and do my work....here I am unable to get the Bitmap</p>

<p>Here is the xml for custom RadioButton:</p>

<pre><code>&lt;RadioButton

 android:id="@+id/childLft"
        android:layout_width="69dp"
        android:layout_height="69dp"
        android:layout_x="256dp"
        android:layout_y="199dp"
        android:button="@drawable/child_left_custom" 
        android:background="@drawable/empty"/&gt; 
</code></pre>

<p>And the java code:
public class CarTwoThree extends Activity {</p>

<pre><code>RadioButton car;

public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.cartwothree);

    car = (RadioButton)findViewById(R.id.carL);
    car.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            int x = (int) event.getX();
            int y = (int) event.getY();
            switch(event.getAction())
            {
                case MotionEvent.ACTION_DOWN:                        
                    break;

                case MotionEvent.ACTION_MOVE:                        
                     break;

                case MotionEvent.ACTION_UP:  
                    Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.id.carL);
                    //car.getResources().getBackground();
                    int C = bitmap.getPixel(x, y);
                    int alpha = Color.alpha(C);
                    System.out.println("X&gt;&gt;&gt;&gt;" + x +  "Y&gt;&gt;&gt;&gt;&gt;&gt;&gt;" + y + alpha);
                     break;
            }
            return false;
        }
    });
}
</code></pre>

<p>}</p>
