SHARE
TWEET

Untitled

a guest Mar 25th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top