# PixelCopy.Request

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Request

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/view/PixelCopy.Request "View this page in Java")  

```
class Request
```

|---|------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                   ||
| ↳ | [android.view.PixelCopy.Request](https://developer.android.com/reference/kotlin/android/view/PixelCopy.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](https://developer.android.com/reference/kotlin/android/view/PixelCopy.Request.Builder)for the given source content. After setting any optional parameters, such as[Builder.setSourceRect(Rect)](https://developer.android.com/reference/kotlin/android/view/PixelCopy.Request.Builder#setSourceRect(android.graphics.Rect)), build the request with[Builder.build()](https://developer.android.com/reference/kotlin/android/view/PixelCopy.Request.Builder#build())and then execute it with[PixelCopy.request(Request, Executor, Consumer)](https://developer.android.com/reference/kotlin/android/view/PixelCopy#request(android.view.PixelCopy.Request,%20java.util.concurrent.Executor,%20java.util.function.Consumer))

## Summary

|                                                                                                                                                                                                                                                                                                     Nested classes                                                                                                                                                                                                                                                                                                      ||
|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|   | [Builder](https://developer.android.com/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)](https://developer.android.com/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()](https://developer.android.com/reference/kotlin/android/view/PixelCopy.Request.Builder#build()) |

|                                                                                                          Public methods                                                                                                          ||
|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| [Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)? | [getDestinationBitmap](https://developer.android.com/reference/kotlin/android/view/PixelCopy.Request#getDestinationBitmap())`()` <br /> |
| [Rect](https://developer.android.com/reference/kotlin/android/graphics/Rect.html#)?     | [getSourceRect](https://developer.android.com/reference/kotlin/android/view/PixelCopy.Request#getSourceRect())`()` <br />               |

## Public methods

### getDestinationBitmap

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getDestinationBitmap(): Bitmap?
```

|                                                                                                                                                            Return                                                                                                                                                            ||
|-----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)? | The destination bitmap as set by[Builder.setDestinationBitmap(Bitmap)](https://developer.android.com/reference/kotlin/android/view/PixelCopy.Request.Builder#setDestinationBitmap(android.graphics.Bitmap))This value may be`null`. |

### getSourceRect

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getSourceRect(): Rect?
```

|                                                                                                                                                    Return                                                                                                                                                    ||
|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Rect](https://developer.android.com/reference/kotlin/android/graphics/Rect.html#)? | The source rect to copy from as set by[Builder.setSourceRect(Rect)](https://developer.android.com/reference/kotlin/android/view/PixelCopy.Request.Builder#setSourceRect(android.graphics.Rect))This value may be`null`. |