www.pudn.com > delphi-Sdk3000-ocx.zip > ColorProperty.pas, change:2005-05-17,size:2805b


unit ColorProperty; 
 
interface 
 
uses 
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, ComCtrls, StdCtrls; 
 
type 
  TformColorProperty = class(TForm) 
    Label1: TLabel; 
    labelBrightness: TLabel; 
    sliderBrightness: TTrackBar; 
    Label3: TLabel; 
    labelContrast: TLabel; 
    sliderContrast: TTrackBar; 
    Label5: TLabel; 
    labelSaturation: TLabel; 
    sliderSaturation: TTrackBar; 
    Label7: TLabel; 
    labelHue: TLabel; 
    sliderHue: TTrackBar; 
    Label9: TLabel; 
    labelSharpness: TLabel; 
    sliderSharpness: TTrackBar; 
    btnClose: TButton; 
    btnDefault: TButton; 
    procedure sliderBrightnessChange(Sender: TObject); 
    procedure sliderContrastChange(Sender: TObject); 
    procedure sliderSaturationChange(Sender: TObject); 
    procedure sliderHueChange(Sender: TObject); 
    procedure sliderSharpnessChange(Sender: TObject); 
    procedure btnCloseClick(Sender: TObject); 
    procedure btnDefaultClick(Sender: TObject); 
  private 
    { Private declarations } 
  public 
    { Public declarations } 
  end; 
 
var 
  formColorProperty: TformColorProperty; 
 
implementation 
 
uses Main; 
 
{$R *.dfm} 
 
procedure TformColorProperty.sliderBrightnessChange(Sender: TObject); 
begin 
    labelBrightness.Caption := IntToStr(sliderBrightness.Position); 
    formMain.SDK30001.Brightness := sliderBrightness.Position; 
end; 
 
procedure TformColorProperty.sliderContrastChange(Sender: TObject); 
begin 
    labelContrast.Caption := IntToStr(sliderContrast.Position); 
    formMain.SDK30001.Contrast := sliderContrast.Position; 
end; 
 
procedure TformColorProperty.sliderSaturationChange(Sender: TObject); 
begin 
    labelSaturation.Caption := IntToStr(sliderSaturation.Position); 
    formMain.SDK30001.Saturation := sliderSaturation.Position; 
end; 
 
procedure TformColorProperty.sliderHueChange(Sender: TObject); 
begin 
    labelHue.Caption := IntToStr(sliderHue.Position); 
    formMain.SDK30001.Hue := sliderHue.Position; 
end; 
 
procedure TformColorProperty.sliderSharpnessChange(Sender: TObject); 
begin 
    labelSharpness.Caption := IntToStr(sliderSharpness.Position); 
    formMain.SDK30001.Sharpness := sliderSharpness.Position; 
end; 
 
procedure TformColorProperty.btnCloseClick(Sender: TObject); 
begin 
    Close(); 
end; 
 
procedure TformColorProperty.btnDefaultClick(Sender: TObject); 
begin 
    sliderBrightness.Position := 128; 
    sliderContrast.Position := 68; 
    sliderSaturation.Position := 64; 
    sliderHue.Position := 0; 
    sliderSharpness.Position := -5; 
     
    sliderBrightnessChange(btnDefault); 
    sliderContrastChange(btnDefault); 
    sliderSaturationChange(btnDefault); 
    sliderHueChange(btnDefault); 
    sliderSharpnessChange(btnDefault); 
end; 
 
end.