请问怎么获得屏幕当前颜色?

解决方案 »

  1.   

    试试这个
    procedure TForm1.Timer1Timer(Sender: TObject);
    var
      CurDC: HDC;
      CurPoint: TPoint;//保存屏幕上的任意点
      Color: TColor;
    begin
      CurDC := GetDC(GetActiveWindow); //GetDesktopWindow
      GetCursorPos(CurPoint);
      CurPoint := ScreenToClient(CurPoint);
      Color := GetPixel(curdc,CurPoint.x,CurPoint.y);//屏幕上的任意点
      Panel1.color:=color;
    end;
      

  2.   

    楼上的,谢谢你的回复!不过得到的颜色不是我想要的,试了一下,Panel1成了黑色的了.我的意思是取得桌面的颜色.不知该怎么办?
      

  3.   

    就好比我问你,你说CSDN的主页是什么颜色的一样?有答案吗?呵呵