# ScreenCapture

Artifact: [androidx.test:runner](https://developer.android.com/jetpack/androidx/releases/test) [View Source](https://cs.android.com/search?q=file:androidx/test/runner/screenshot/ScreenCapture.java+class:androidx.test.runner.screenshot.ScreenCapture)

*** ** * ** ***


```
class ScreenCapture
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> use androidx.test.espresso.screenshot.captureToBitmap or androidx.test.core.app.DeviceCapture instead

A ScreenCapture contains a bitmap of a device screen along with a set of `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCaptureProcessor`s that will be used to process the `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture` when `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#process()` is called.

If no `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCaptureProcessor`s are added to the list the `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/BasicScreenCaptureProcessor` is used when `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#process()` is called.

If a set of processors are supplied with the call to `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#process()` then those processors will take precedence over the set of global processors and the `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/BasicScreenCaptureProcessor`.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[equals](https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#equals(java.lang.Object))(obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `[getName](https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#getName())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[hashCode](https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#hashCode())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[process](https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#process())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[process](https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#process(java.util.Set<androidx.test.runner.screenshot.ScreenCaptureProcessor>))(processorSet: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCaptureProcessor!>)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture!` | `[setName](https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#setName(java.lang.String))(filename: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` **This function is deprecated.** Deprecated in Java |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/android/graphics/Bitmap.html!` | `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#bitmap()` **This property is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/android/graphics/Bitmap.CompressFormat.html!` | `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#format()` **This property is deprecated.** Deprecated in Java |

## Public functions

### equals

```
fun [equals](https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#equals(java.lang.Object))(obj: Any!): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

### getName

```
fun [getName](https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#getName())(): String!
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns the filename to save the bitmap as or null if none has been set.

### hashCode

```
fun [hashCode](https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#hashCode())(): Int
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

### process

```
fun [process](https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#process())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Process the `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture` using the global set of `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCaptureProcessor`s or the `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/BasicScreenCaptureProcessor` if no processors are set.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | if there is an IOException while any of the processors are processing the ScreenCapture |

### process

```
fun [process](https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#process(java.util.Set<androidx.test.runner.screenshot.ScreenCaptureProcessor>))(processorSet: (Mutable)Set<ScreenCaptureProcessor!>): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Process the `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture` using the given set of `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCaptureProcessor`s or the `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/BasicScreenCaptureProcessor` if no processors are in the given set.

| Parameters |
|---|---|
| `processorSet: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCaptureProcessor!>` | the set of processors to use to process the ScreenCapture |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | if there is an IOException while any of the processors are processing the ScreenCapture |

### setName

```
fun [setName](https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture#setName(java.lang.String))(filename: String!): ScreenCapture!
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Sets the filename to save the `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture` as.

| Parameters |
|---|---|
| `filename: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | the filename to use to save the capture as |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/runner/screenshot/ScreenCapture!` | a fluent interface |

## Public properties

### bitmap

```
val bitmap: Bitmap!
```

> [!CAUTION]
> **This property is deprecated.**   
> Deprecated in Java

### format

```
var format: Bitmap.CompressFormat!
```

> [!CAUTION]
> **This property is deprecated.**   
> Deprecated in Java