Skip to main content
Version: next

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

// 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,
});
  • newDisplay: Creates a new virtual display for video streaming
  • flexDisplay: Enables flexible display mode for dynamic resizing