How to draw a bitmap on a GradientDrawable?
<p>This is my non-working code:</p>

<pre><code> GradientDrawable sh = new GradientDrawable();          // create a gradient drawable.          
 Bitmap cbm = bmp.copy(Bitmap.Config.ARGB_8888, true);  // do not use an immutable bitmap.

 Canvas cv = new Canvas(cbm);  //create a canvas using the mutable bitmap.

 sh.setAlpha(255);  // this has no effect?
 sh.draw(cv);       // does nothing?

 sh.setStroke(thik, clr);      //this works fine.  
 sh.setCornerRadius(radius);   // This works fine. 

 v.setBackgroundDrawable(sh);  // displays a rounded corner box with transparent center (no bitmap!!).
</code></pre>

<p>Im sure i am doing something wrong but i dont know what i am doing wrong. I hope this is not yet another case where Java code converts a simple function call into a full blown event with messages to catch and stuff.</p>

<p>Help?</p>

<p>Basically what i need is a button that has the corners a little rounded, with a stroke of 2 or 3 pixels and a stretched bitmap in the center (The rounded stroke corners should cover the corners of the bitmap).</p>

<p>Thanks.</p>