Thursday 16 August 2012

Draw Transprent Bitmap on Android Canvas

Bitmap bitmap2 =Bitmap.createBitmap(bmp.getWidth(), bmp.getHeight(), Bitmap.Config.ARGB_8888);
        int width = bmp.getWidth();
        int height = bmp.getHeight();
        for(int x = 0; x < width; x++)
        {
            for(int y = 0; y < height; y++)
            {
              
                    bitmap2.setPixel(x, y, Color.TRANSPARENT);
             }
        }
        canvas.drawBitmap( bitmap2, 10, 10, p);

No comments:

Post a Comment