Resize Display
info
Added in Scrcpy v4.0
Resize a virtual display to a custom resolution.
This control message allows dynamically changing the size of a virtual display during an active Scrcpy session. The server will adjust the video stream to match the new display dimensions.
note
This control message only works with virtual displays created using newDisplay with flexDisplay enabled.
Options
interface ScrcpyResizeDisplayControlMessage {
width: number;
height: number;
}
width: The new display width in pixels.height: The new display height in pixels.
Usage
- JavaScript
- TypeScript
// Using `ScrcpyControlMessageSerializer`
const message = serializer.resizeDisplay({
width: 1920,
height: 1080,
});
// Using `ScrcpyControlMessageWriter`
await writer.resizeDisplay({
width: 1920,
height: 1080,
});
// Using `AdbScrcpyClient`
await client.controller.resizeDisplay({
width: 1920,
height: 1080,
});
// Using `ScrcpyControlMessageSerializer`
const message: Uint8Array = serializer.resizeDisplay({
width: 1920,
height: 1080,
});
// Using `ScrcpyControlMessageWriter`
await writer.resizeDisplay({
width: 1920,
height: 1080,
});
// Using `AdbScrcpyClient`
await client.controller!.resizeDisplay({
width: 1920,
height: 1080,
});
Related options
newDisplay: Creates a new virtual display for video streamingflexDisplay: Enables flexible display mode for dynamic resizing