码迷,mamicode.com
首页 > 其他好文 > 详细

全局探色器

时间:2019-09-04 09:30:05      阅读:105      评论:0      收藏:0      [点我收藏+]

标签:end   win   nta   timer   variant   led   self   form   sse   

 

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Timer1: TTimer;
Edit1: TEdit;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
Timer1.Enabled := False;
Timer1.Interval := 100;
Button1.Default := True;
Button1.Caption := 用回车操作这个按钮;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Timer1.Enabled := not Timer1.Enabled;
if Timer1.Enabled then Button1.Caption := 开始
else Button1.Caption := 停止;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
pt: TPoint;
c: TColor;
begin
GetCursorPos(pt);
c := GetPixel(GetDC(0), pt.X, pt.Y);
Self.Color := c;
Edit1.Text := Format($%.6x, [c]);
end;

end.

 


全局探色器

标签:end   win   nta   timer   variant   led   self   form   sse   

原文地址:https://www.cnblogs.com/blogpro/p/11456907.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!