Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void renderDrawableToBitmap(Drawable d, Bitmap bitmap, int x, int y, int w, int h,
- float scale, int multiplyColor) {
- if (bitmap != null) {
- Canvas c = new Canvas(bitmap);
- c.scale(scale, scale);
- Rect oldBounds = d.copyBounds();
- d.setBounds(x, y, x + w, y + h);
- d.draw(c);
- d.setBounds(oldBounds); // Restore the bounds
- if (multiplyColor != 0xFFFFFFFF) {
- c.drawColor(mDragViewMultiplyColor, PorterDuff.Mode.MULTIPLY);
- }
- c.setBitmap(null);
- c = null;
- }
- }
Add Comment
Please, Sign In to add comment