Documentation
¶
Index ¶
- Constants
- func CaptureRegion(x, y, w, h int32) (*image.RGBA, error)
- func CaptureVirtualDesktop() (*image.RGBA, error)
- func CaptureVirtualDesktopWithOptions(opts CaptureOptions) (*image.RGBA, error)
- func ImageToVirtual(imageX, imageY int32) (int32, int32)
- type BITMAPINFOHEADER
- type CaptureOptions
- type Monitor
- type Point
- type Rect
Constants ¶
const ( SRCCOPY = 0x00CC0020 DIB_RGB_COLORS = 0 BI_RGB = 0 // GetSystemMetrics constants SM_XVIRTUALSCREEN = 76 SM_YVIRTUALSCREEN = 77 SM_CXVIRTUALSCREEN = 78 SM_CYVIRTUALSCREEN = 79 )
GDI Constants
Variables ¶
This section is empty.
Functions ¶
func CaptureRegion ¶
CaptureRegion captures a specific region of the virtual desktop. x, y: Virtual desktop coordinates (allowed to be negative). w, h: Pixel dimensions of the region to capture.
func CaptureVirtualDesktop ¶
CaptureVirtualDesktop captures the entire virtual desktop (all monitors). It returns an *image.RGBA ready for OpenCV or other processing. It requires the process to be Per-Monitor DPI Aware.
func CaptureVirtualDesktopWithOptions ¶
func CaptureVirtualDesktopWithOptions(opts CaptureOptions) (*image.RGBA, error)
CaptureVirtualDesktopWithOptions captures the virtual desktop with custom options.
func ImageToVirtual ¶
ImageToVirtual converts coordinates from a "Full Virtual Desktop Screenshot" to actual Windows Virtual Desktop coordinates.
Use this when you capture the entire multi-monitor desktop as a single image (origin 0,0) and find a match at (imageX, imageY).
Returns (x, y) ready for use with winput.MoveMouseTo / winput.ClickMouseAt.
Constraints: 1. The image MUST be a capture of the entire virtual desktop (all monitors). 2. The capture process MUST be Per-Monitor DPI Aware (matching winput). 3. Do NOT modify the returned negative coordinates; they are valid.
Types ¶
type BITMAPINFOHEADER ¶
type CaptureOptions ¶
type CaptureOptions struct {
PreserveAlpha bool
MaxMemoryMB int // Max memory usage in MB, 0 means default limit (500MB)
}
CaptureOptions defines configuration for screen capture.
type Monitor ¶
type Monitor struct {
Handle uintptr
Bounds Rect
WorkArea Rect // Excludes taskbar
Primary bool
DeviceName string
}
Monitor represents a physical display device.