fun makeScreenshot()

in robot-server-core/src/main/kotlin/com/intellij/remoterobot/services/IdeRobot.kt [254:268]


    fun makeScreenshot(componentId: String): Result<ByteArray> {
        val componentContext =
            componentContextCache[componentId] ?: throw IllegalStateException("Unknown component id $componentId")
        return getResult(componentContext) {
            val componentLocation = componentContext.component.locationOnScreen
            robot.makeScreenshot(
                Rectangle(
                    componentLocation.x,
                    componentLocation.y,
                    componentContext.component.width,
                    componentContext.component.height
                )
            )
        }
    }