Stay organized with collections
Save and categorize content based on your preferences.
Request
class Request
Represents a PixelCopy request. To create a copy request, use either of the PixelCopy.Request.ofWindow or PixelCopy.Request.ofSurface factories to create a Request.Builder
for the given source content. After setting any optional parameters, such as Builder.setSourceRect(Rect)
, build the request with Builder.build()
and then execute it with PixelCopy.request(Request, Executor, Consumer)
Summary
Public methods
getDestinationBitmap
fun getDestinationBitmap(): Bitmap?
getSourceRect
fun getSourceRect(): Rect?
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-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# PixelCopy.Request\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nRequest\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/PixelCopy.Request \"View this page in Java\") \n\n```\nclass Request\n```\n\n|---|-------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.view.PixelCopy.Request](#) |\n\nRepresents a PixelCopy request. To create a copy request, use either of the PixelCopy.Request.ofWindow or PixelCopy.Request.ofSurface factories to create a [Request.Builder](/reference/kotlin/android/view/PixelCopy.Request.Builder) for the given source content. After setting any optional parameters, such as [Builder.setSourceRect(Rect)](/reference/kotlin/android/view/PixelCopy.Request.Builder#setSourceRect(android.graphics.Rect)), build the request with [Builder.build()](/reference/kotlin/android/view/PixelCopy.Request.Builder#build()) and then execute it with [PixelCopy.request(Request, Executor, Consumer)](/reference/kotlin/android/view/PixelCopy#request(android.view.PixelCopy.Request,%20java.util.concurrent.Executor,%20java.util.function.Consumer))\n\nSummary\n-------\n\n| Nested classes ||\n|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [Builder](/reference/kotlin/android/view/PixelCopy.Request.Builder) A builder to create the complete PixelCopy request, which is then executed by calling [request(android.view.PixelCopy.Request,java.util.concurrent.Executor,java.util.function.Consumer)](/reference/kotlin/android/view/PixelCopy#request(android.view.PixelCopy.Request,%20java.util.concurrent.Executor,%20java.util.function.Consumer)) with the built request returned from [build()](/reference/kotlin/android/view/PixelCopy.Request.Builder#build()) |\n\n| Public methods ||\n|-------------------------------------|------------------------------------------------------------|\n| [Bitmap](../graphics/Bitmap.html#)? | [getDestinationBitmap](#getDestinationBitmap())`()` \u003cbr /\u003e |\n| [Rect](../graphics/Rect.html#)? | [getSourceRect](#getSourceRect())`()` \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### getDestinationBitmap\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getDestinationBitmap(): Bitmap?\n```\n\n| Return ||\n|-------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Bitmap](../graphics/Bitmap.html#)? | The destination bitmap as set by [Builder.setDestinationBitmap(Bitmap)](/reference/kotlin/android/view/PixelCopy.Request.Builder#setDestinationBitmap(android.graphics.Bitmap)) This value may be `null`. |\n\n### getSourceRect\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getSourceRect(): Rect?\n```\n\n| Return ||\n|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Rect](../graphics/Rect.html#)? | The source rect to copy from as set by [Builder.setSourceRect(Rect)](/reference/kotlin/android/view/PixelCopy.Request.Builder#setSourceRect(android.graphics.Rect)) This value may be `null`. |"]]