Stay organized with collections
Save and categorize content based on your preferences.
Xfermode
open class Xfermode
Xfermode is the base class for objects that are called to implement custom "transfer-modes" in the drawing pipeline. The static function Create(Modes) can be called to return an instance of any of the predefined subclasses as specified in the Modes enum. When an Xfermode is assigned to a Paint, then objects drawn with that paint have the xfermode applied.
Summary
Public constructors
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-03-13 UTC.
[null,null,["Last updated 2025-03-13 UTC."],[],[],null,["# Xfermode\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nXfermode\n========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/graphics/Xfermode \"View this page in Java\") \n\n```\nopen class Xfermode\n```\n\n|---|--------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.graphics.Xfermode](#) |\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [PorterDuffXfermode](/reference/kotlin/android/graphics/PorterDuffXfermode), [RuntimeXfermode](/reference/kotlin/android/graphics/RuntimeXfermode) |-----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [PorterDuffXfermode](/reference/kotlin/android/graphics/PorterDuffXfermode) | Specialized implementation of [Paint](/reference/kotlin/android/graphics/Paint)'s [transfer mode](/reference/kotlin/android/graphics/Paint#setXfermode(android.graphics.Xfermode)). | | [RuntimeXfermode](/reference/kotlin/android/graphics/RuntimeXfermode) | A [RuntimeXfermode](/reference/kotlin/android/graphics/RuntimeXfermode) calculates a per-pixel color based on the output of a user \\* defined Android Graphics Shading Language (AGSL) function. | |\n\nXfermode is the base class for objects that are called to implement custom \"transfer-modes\" in the drawing pipeline. The static function Create(Modes) can be called to return an instance of any of the predefined subclasses as specified in the Modes enum. When an Xfermode is assigned to a Paint, then objects drawn with that paint have the xfermode applied.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------|---|\n| [Xfermode](#Xfermode())`()` \u003cbr /\u003e |\n\nPublic constructors\n-------------------\n\n### Xfermode\n\n```\nXfermode()\n```"]]