Leser: 1
8 Einträge, 1 Seite |
@pixfarb = $screen -> GetPixel (1, 1);
QuoteGetPixel (x, y)
Return pixel value color at x, y or undef if error. For image with BPP <= 8 return palette index color. For image with BPP > 8 return color value. This color value can be an integer value or a [B,G,R,A] array.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl
use strict;
use warnings;
use Win32::GUI;
my $screen = new Win32::GUI::DC("DISPLAY");
my $pixel = $screen -> GetPixel( 5, 5 );
print "PIXEL: $pixel\n";
my $r = ($pixel << 24) >> 24;
my $g = ($pixel << 16) >> 24;
my $b = ($pixel << 8) >> 24;
my $a = ($pixel ) >> 24;
print "R: $r\n";
print "G: $g\n";
print "B: $b\n";
8 Einträge, 1 Seite |