BSOne.SFC/EM.Lib/ImageEn_SRC/Demos/ImageEditing/MakeTransparent/upick.pas

55 lines
1.1 KiB
Plaintext

unit upick;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, hyiedefs;
type
TPickDialog = class(TForm)
Label1: TLabel;
PickColor: TShape;
Label2: TLabel;
ColorDialog1: TColorDialog;
Button1: TButton;
Label3: TLabel;
procedure Button1Click(Sender: TObject);
procedure PickColorMouseDown(Sender: TObject; Button: TMouseButton; Shift:
TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
PickDialog: TPickDialog;
implementation
uses
umain, imageenproc, hyieutils;
{$R *.DFM}
procedure TPickDialog.Button1Click(Sender: TObject);
begin
MainForm.SetTransparent;
end;
procedure TPickDialog.PickColorMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ColorDialog1.Color := PickColor.Brush.Color;
if ColorDialog1.Execute then
begin
PickColor.Brush.Color := ColorDialog1.Color;
with TColor2TRGB( PickColor.Brush.Color ) do
Label3.Caption := IntToStr(r)+', '+IntToStr(g)+', '+IntToStr(b);
end;
end;
end.