Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. fun Bitmap.maskWith(destinationImage: Bitmap, mode: PorterDuff.Mode): Bitmap {
  2. val result = this.copy(Bitmap.Config.ARGB_8888, true)
  3. val canvas = Canvas(result)
  4.  
  5. val paint = Paint()
  6. canvas.drawBitmap(destinationImage, 0f, 0f, paint)
  7. paint.xfermode = PorterDuffXfermode(mode)
  8.  
  9. canvas.drawBitmap(this, 0f, 0f, paint)
  10.  
  11. return result
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement