about uscontact

Make Bitmap instance from Drawable

Author: zemna
Date: April 17, 2021
Share this:

[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 d.draw(canvas);

// Save canvas canvas.save(); [/code]

Share this:

Leave a Reply

Your email address will not be published.


Professional software development agency estalished in Indonesia. We offers website setup, web application development, fulfillment service, and etc.
Follow us
Follow us to get latest news and tutorials.
2022 - Copyright, All Rights Reserved, Made by ZEMNA.NET with ❤️