how to fit png background image to the size of imagebutton in android sdk
<p>i have created an image button in my xml</p>

<pre><code>    &lt;Button android:layout_height="wrap_content" 
        android:id="@+id/send" 
        android:layout_width="50dip"
        android:background="@drawable/button_back"&gt;
    &lt;/Button&gt;
</code></pre>

<p>and its background like this "button_back.xml"</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
 &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
     &lt;item android:state_pressed="true"
           android:drawable="@drawable/back_pressed" /&gt; &lt;!-- pressed png --&gt;
     &lt;item android:state_focused="true"
           android:drawable="@drawable/back_focused" /&gt; &lt;!-- focused png --&gt;
     &lt;item android:drawable="@drawable/back_normal" /&gt; &lt;!-- default png --&gt;
 &lt;/selector&gt;
</code></pre>

<p>its working fine but my problem is that my button width is 50 and my image png width is 70.
how can i fit this png to get resized  to my button width automatically. Right now no matter what width i give to my button its width gets to the size of image png width.</p>

<p>can someone help me how to do this.</p>

<p>Thanks</p>
