1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
Add-Type -AssemblyName PresentationCore, WindowsBase, System.Windows.Forms $color = [System.Drawing.Color]::FromArgb(0,0,0) $screen = [System.Windows.Forms.SystemInformation]::VirtualScreen $bounds = [System.Drawing.Rectangle]::new($screen.Left, $screen.Top, $screen.Width, $screen.Height) $image = New-Object System.Drawing.Bitmap $bounds.Width, $bounds.Height $graphics = [System.Drawing.Graphics]::FromImage($image) $graphics.CopyFromScreen($bounds.Location, [System.Drawing.Point]::Empty, $bounds.Size) for ($x = 0; $x -lt $image.Width; $x++) { for ($y = 0; $y -lt $image.Height; $y++) { if ($image.GetPixel($x, $y) -eq $color) { "color encontrado" } } } |