Autor Beitrag
ähM_Key
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 88

Windows XP Professional
D7 Enterprise
BeitragVerfasst: Do 24.11.05 16:18 
Hi!

Ich suche eine Möglichkeit, wie ich die Farbe eines Pixels an einem bestimmten Ort außerhalb der Form bestimmen kann.

Über Canvas.Pixels[X,Y] geht das ja nicht, da ich ja in dem Sinne kein Objekt habe (z.B. TImage), auf was ich das anwenden kann, oder?

Im Prinzip benötige ich die Bildinformation, die man auch durch einen Screenshot erhalten würde, was aber so zu lange dauert!?!

Grüße; ähM_Key

_________________
Alles geht ni! Aber ein bissl' was muss!
Lossy eX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1048
Erhaltene Danke: 4



BeitragVerfasst: Do 24.11.05 16:31 
Schau mal. So bekommst du ein Canvas welches als Fenster den Desktop hat. Und dann kanns los gehen. ;-)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure TForm1.Button1Click(Sender: TObject);
var
  DC: HDC;
  Can: TCanvas;
begin
  Can := TCanvas.Create;
  try
    DC := GetDC(0);
    try 
      Can.Handle := DC; 
      Color := Can.Pixels[0,0];
    finally
      ReleaseDC(0, DC);
    end;
  finally
    FreeAndNil(Can);
  end;
end;

_________________
Nur die Menschheit ist arrogant genug, um zu glauben sie sei die einzige intelligente Lebensform im All. Wo nicht mal das nachhaltig bewiesen wurde.
ähM_Key Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 88

Windows XP Professional
D7 Enterprise
BeitragVerfasst: Do 24.11.05 16:46 
Funzt!

Vielen Dank!

MK

_________________
Alles geht ni! Aber ein bissl' was muss!