{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
public final class ScreenCapture
A ScreenCapture contains a bitmap of a device screen along with a set of ScreenCaptureProcessors that will be used to process the ScreenCapture when is called.
If no ScreenCaptureProcessors are added to the list the BasicScreenCaptureProcessor is used when process is called.
If a set of processors are supplied with the call to process then those processors will take precedence over the set of global processors and the BasicScreenCaptureProcessor.
This API is currently in beta.
Public methods |
|
|---|---|
@NonNull boolean |
|
@NonNull Bitmap |
Returns the Bitmap that was set when the |
@NonNull CompressFormat |
Returns the format to save the bitmap as or PNG if none has been set. |
@NonNull String |
getName()Returns the filename to save the bitmap as or null if none has been set. |
@NonNull int |
hashCode() |
@NonNull void |
process()Process the |
@NonNull void |
process(@NonNull Set<@NonNull ScreenCaptureProcessor> processorSet)Process the |
@NonNull ScreenCapture |
Sets the format to save the |
@NonNull ScreenCapture |
Sets the filename to save the |
@NonNull
public Bitmap getBitmap()
Returns the Bitmap that was set when the ScreenCapture was created.
@NonNull
public CompressFormat getFormat()
Returns the format to save the bitmap as or PNG if none has been set.
@NonNull
public String getName()
Returns the filename to save the bitmap as or null if none has been set.
@NonNull
public void process()
Process the ScreenCapture using the global set of ScreenCaptureProcessors or the BasicScreenCaptureProcessor if no processors are set.
| Throws | |
|---|---|
java.io.IOException |
if there is an IOException while any of the processors are processing the ScreenCapture |
@NonNull
public void process(@NonNull Set<@NonNull ScreenCaptureProcessor> processorSet)
Process the ScreenCapture using the given set of ScreenCaptureProcessors or the BasicScreenCaptureProcessor if no processors are in the given set.
| Parameters | |
|---|---|
@NonNull Set<@NonNull ScreenCaptureProcessor> processorSet |
the set of processors to use to process the ScreenCapture |
| Throws | |
|---|---|
java.io.IOException |
if there is an IOException while any of the processors are processing the ScreenCapture |
@NonNull
public ScreenCapture setFormat(@NonNull CompressFormat format)
Sets the format to save the ScreenCapture as.
| Parameters | |
|---|---|
@NonNull CompressFormat format |
the format to use to save the screenshot as |
| Returns | |
|---|---|
ScreenCapture |
a fluent interface |
@NonNull
public ScreenCapture setName(@NonNull String filename)
Sets the filename to save the ScreenCapture as.
| Returns | |
|---|---|
ScreenCapture |
a fluent interface |