procedure TForm1.Button3Click(Sender: TObject);
var
Color: TColor;
x, y, i, high_r, high_g, high_b, end_r, end_g, end_b: integer;
ColorArray:
array[0..2, 0..255]
of cardinal;
begin
for y := 200
to 210
do
begin
for x := 200
to 210
do
begin
Color := GetDesktopColor(x, y);
inc(ColorArray[0, GetRValue(Color)]);
inc(ColorArray[1, GetGValue(Color)]);
inc(ColorArray[2, GetBValue(Color)]);
end;
end;
for i := 0
to 255
do
begin
if ColorArray[0, i] > high_r
then
begin
high_r := ColorArray[0, i];
end_r := i;
end;
if ColorArray[1, i] > high_g
then
begin
high_g := ColorArray[1, i];
end_g := i;
end;
if ColorArray[2, i] > high_b
then
begin
high_b := ColorArray[2, i];
end_b := i;
end;
end;
ShowMessage(IntToStr(end_r));
ShowMessage(IntToStr(end_g));
ShowMessage(IntToStr(end_b));
JvPanel2.Color :=
RGB(end_r, end_g, end_b);
end;