Make Bitmap instance from Drawable

[code lang=”java”] // Create empty bitmap
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);

// Create canvas to draw drawable
Canvas canvas = new Canvas(bitmap);

// Set bounds
d.setBounds(0, 0, 48, 48);

// Draw drawable to canvas

// Save canvas;

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *