Тема: Deiphi 7
Показать сообщение отдельно
Старый 05.05.2006, 18:29   #6
Slyer
Новичок
 
Регистрация: 04.05.2006
Сообщений: 14
Вы сказали Спасибо: 0
Поблагодарили 0 раз(а) в 0 сообщениях
По умолчанию

var
CursorPos : TPoint ;
DeviceContext: HDC ;
CapturedColor: Cardinal ;
begin
CapturedColor := 0 ;

DeviceContext := GetDC(0) ;
if DeviceContext > 0 then
begin
try
if GetCursorPos(CursorPos) then
CapturedColor := GetPixel(DeviceContext, CursorPos.x, CursorPos.y) ;
finally
DeleteDC(DeviceContext) ;
end ;
end ;

//if CapturedColor <> -1 then
//begin
// self.Canvas.Brush.Color := CapturedColor ;
// self.Canvas.FillRect(self.GetClientRect())
//end
end ;
Slyer вне форума