Are you sure that it is the bitmap that has the black background? How are you using the bitmap? Is it the background or foreground of an ImageView?
Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Mon, Apr 2, 2012 at 10:33 AM, Perry <[email protected]> wrote: > hi, > thank you for help. but the background still black. > > On 4月3日, 上午12時05分, Justin Anderson <[email protected]> wrote: > > First, you should use ARGB_8888... ARGB_4444 is deprecated: > http://developer.android.com/reference/android/graphics/Bitmap.Config... > > > > Next, here is how to do it: > > > > temp = Bitmap.createBitmap(thisWidth, thisHeight, Config.ARGB_8888); > > > > //Clear the canvas > > Canvas canvas = new Canvas(temp); > > > > Paint transPainter = new Paint(); > > transPainter.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR)); > > > > canvas.DrawRect(0, 0, temp.Width, temp.Height, transPainter); > > > > Hope that helps... > > > > Thanks, > > Justin Anderson > > MagouyaWare Developerhttp://sites.google.com/site/magouyaware > > > > > > > > On Mon, Apr 2, 2012 at 9:54 AM, Perry <[email protected]> wrote: > > > hi, > > > > > I used following method to create a canvas. > > > > > temp = Bitmap.createBitmap(thisWidth, thisHeight, Config.ARGB_4444); > > > Canvas thisCanvas = new Canvas(temp); > > > > > I don't know why the canvas has a black background. How to create a > > > Transparent background for use? > > > > > Thanks a lot! > > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Developers" group. > > > To post to this group, send email to > [email protected] > > > To unsubscribe from this group, send email to > > > [email protected] > > > For more options, visit this group at > > >http://groups.google.com/group/android-developers?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

