Re: Getting screen display pixel color value [SOLVED] lazarus / 21-General ---------------------------------------------------------------------- Davo · 2021-08-19 04:35 I'm running Lazarus version #:2.0.10; FPC version: 3.2.0; SVN Revision: 63526. While this may possibly be a bit dated I doubt that that fact is causing my difficulty. Given : 1. a transparent form that covers the display screen, 2. the form has a visible square shape three pixels wide and three pixels tall, 3. the square can be moved across the display screen at will, 4. it is possible to determine the square's current screen coordinates is it possible to determine the pixel RGB value of the screen display that underlies (say) the square's centre pixel? The following code obtained from the Forum seems to be what I want : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,  Windows; function TForm1.ReadScreenColor(const X, Y: integer): TColor;var  ScreenDC: HDC;  SaveBitmap: TBitmap;begin  SaveBitmap := TBitmap.Create;  try    SaveBitmap.SetSize(Screen.Width, Screen.Height);    ScreenDC := GetDC(0);    try      SaveBitmap.LoadFromDevice(ScreenDC);    finally      ReleaseDC(0, ScreenDC);    end;    Result := SaveBitmap.Canvas.Pixels[X, Y];  finally    SaveBitmap.Free;  end;end; However I get a compiler error at the line SaveBitmap := TBitmap.create; The error is “identifier idents no member “Create”. Clearly I'm doing something wrong. Any help will be much appreciated. ---------------------------------------------------------------------- dseligo · 2021-08-19 06:22 In uses section put Windows in front of Graphics, like that: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  Classes, SysUtils, Forms, Controls, Windows, Graphics, Dialogs, ExtCtrls, StdCtrls; ---------------------------------------------------------------------- Davo · 2021-08-19 06:49 Many thanks dseligo. Works just fine now. ---------------------------------------------------------------------- paweld · 2021-08-19 07:36 or: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  //...  SaveBitmap: Graphics.TBitmap;begin  SaveBitmap := Graphics.TBitmap.Create;  //... ---------------------------------------------------------------------- Davo · 2021-08-21 03:04 Thanks psweld. Yes works also. Much appreciated.