为何无法取得屏幕外的坐标颜色?
大虾有空请帮看看...谢了procedure TCovColorForm.FormMouseDown(Sender: TObject;Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
t:tcolor;
DeskCanvas : TCanvas;
CurrentPos : TPoint;
begin
//当点击左键时取得颜色
if (ssLeft in Shift) then
begin
GetCursorPos(CurrentPos);
DeskCanvas := TCanvas.Create;
DeskCanvas.Handle := GetDC(0);
ScrollBox1.Color:=DeskCanvas.Pixels[CurrentPos.X,CurrentPos.Y];
DeskCanvas.Free;
end;
end;
大虾有空请帮看看...谢了procedure TCovColorForm.FormMouseDown(Sender: TObject;Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
t:tcolor;
DeskCanvas : TCanvas;
CurrentPos : TPoint;
begin
//当点击左键时取得颜色
if (ssLeft in Shift) then
begin
GetCursorPos(CurrentPos);
DeskCanvas := TCanvas.Create;
DeskCanvas.Handle := GetDC(0);
ScrollBox1.Color:=DeskCanvas.Pixels[CurrentPos.X,CurrentPos.Y];
DeskCanvas.Free;
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货