uses BGRABitmap, BGRABitmapTypes;
procedure InspectColors(AWidth, AHeight: Integer);
var
Bmp: TBGRABitmap;
X, Y: integer;
p: PBGRAPixel;
begin
Bmp := TBGRABitmap.Create(AWidth, AHeight);
try
Bmp.TakeScreenshot(TRect.Create(0, 0, AWidth, AHeight));
for Y := 0 to AHeight - 1 do
begin
P := Bmp.Scanline[Y];
for X := 0 to AWidth - 1 do
begin
//do something with P^.Red, P^.Green, P^.Blue, P^.Alpha
Inc(P);
end;
end;
finally
Bmp.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
InspectColors(Screen.Width, Screen.Height); //or BrowserWindow width and heigth
end;