|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > Screenshot Tools - Screen capture operations > MCP Commands - Screenshot Tools |
MiniRobot Language (MRL) - MCP Screenshot Tools Commands
MCP.ShotSetCaptureMode / SHOT.SETCAPTUREMODE
Set Screenshot Capture Mode
Purpose
The SHOT.SETCAPTUREMODE command configures the capture method used for subsequent screenshot operations. Different capture modes may offer varying performance characteristics, compatibility with different display configurations, or quality levels. This allows scripts to optimize screenshot capture based on specific requirements.
This command is particularly useful when:
• Optimizing screenshot performance for high-frequency captures
• Working with multiple monitors or special display configurations
• Adjusting quality vs speed trade-offs
• Ensuring compatibility with different Windows versions
• Capturing specific types of content (e.g., layered windows)
Syntax
SHOT.SETCAPTUREMODE|$$MODE|$$RETURN_VAR
Parameters
$$MODE - The capture mode to set. Valid modes include: 0=Default (automatic), 1=GDI (BitBlt), 2=DirectX, 3=PrintWindow. The availability of modes depends on the server configuration and system capabilities.
$$RETURN_VAR - The variable that will receive the result (1 for success, 0 for failure).
Capture Modes
0 - Default
Automatically selects the best available capture method based on system capabilities and current configuration.
1 - GDI (BitBlt)
Uses the standard Windows GDI BitBlt function. Widely compatible but may not capture layered windows or hardware-accelerated content.
2 - DirectX
Uses DirectX for hardware-accelerated capture. Better performance for games and video content, but requires DirectX support.
3 - PrintWindow
Uses the PrintWindow API. Can capture obscured windows and layered content, but may be slower than other methods.
Return Value
1 - The capture mode was successfully set
0 - Failed to set the capture mode (invalid mode or unsupported)
Examples
' Example 1: Set GDI capture mode
SHOT.SETCAPTUREMODE|1|$$Result
IVV.$$Result!0
PRT.GDI capture mode set successfully
ELS.
PRT.Failed to set capture mode
EIF.
' Example 2: Set mode for game capture and take screenshot
' Use DirectX mode for better game compatibility
SHOT.SETCAPTUREMODE|2|$$SetResult
IVV.$$SetResult!0
PRT.DirectX mode activated
SHOT.SCREEN|$$GameScreenshot
PRT.Game screenshot: $$GameScreenshot
ELS.
PRT.Falling back to default capture mode
EIF.
' Example 3: Reset to default mode
SHOT.SETCAPTUREMODE|0|$$ResetResult
PRT.Capture mode reset to default
Remarks
The capture mode setting persists for the duration of the MCP server session or until changed by another SHOT.SETCAPTUREMODE command. The default mode (0) is typically the best choice for most applications as it automatically selects an appropriate method.
Not all capture modes may be available on all systems. If a requested mode is not supported, the command will return 0 and the previous mode will remain active. Use the SHOT.SETFALLBACK command to configure automatic fallback behavior.
MCP.ShotSetCaptureMode and SHOT.SETCAPTUREMODE are aliases for the same command. You can use either form.
Error Conditions
The command will fail with an error if:
• The mode parameter is missing or invalid
• The return variable parameter is missing
• The ScreenshotTools feature is disabled in the server configuration
• The requested capture mode is not available on the system
See also:
• SHOT.SETFALLBACK - Set Fallback Mode
• SHOT.SETPARSEMODE - Set Parse Mode
• SHOT.SCREEN - Capture Screenshot