Config.~pas
上传用户:mjqmds
上传日期:2022-05-05
资源大小:2827k
文件大小:5k
- unit Config;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, TFlatEditUnit, TFlatSpinEditUnit, LMDCustomControl,
- LMDCustomPanel, LMDCustomTrackBar, LMDTrackBar, TFlatSpeedButtonUnit,
- TFlatButtonUnit;
- type
- TForm1 = class(TForm)
- FlatSpinEditInteger1: TFlatSpinEditInteger;
- LMDTrackBar2: TLMDTrackBar;
- LMDTrackBar1: TLMDTrackBar;
- LMDTrackBar3: TLMDTrackBar;
- LMDTrackBar4: TLMDTrackBar;
- LMDTrackBar5: TLMDTrackBar;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Label5: TLabel;
- Label6: TLabel;
- FlatSpeedButton1: TFlatSpeedButton;
- FlatSpeedButton2: TFlatSpeedButton;
- FlatSpeedButton3: TFlatSpeedButton;
- FlatSpeedButton4: TFlatSpeedButton;
- FlatSpeedButton5: TFlatSpeedButton;
- FlatButton1: TFlatButton;
- FlatButton2: TFlatButton;
- procedure LMDTrackBar5Track(Sender: TObject; ScrollCode: TScrollCode;
- var ScrollPos: Integer);
- procedure LMDTrackBar4Track(Sender: TObject; ScrollCode: TScrollCode;
- var ScrollPos: Integer);
- procedure FormShow(Sender: TObject);
- procedure FlatSpeedButton1Click(Sender: TObject);
- procedure FlatSpeedButton2Click(Sender: TObject);
- procedure FlatSpeedButton3Click(Sender: TObject);
- procedure FlatSpeedButton4Click(Sender: TObject);
- procedure FlatSpeedButton5Click(Sender: TObject);
- procedure FlatButton1Click(Sender: TObject);
- procedure FlatButton2Click(Sender: TObject);
- private
- procedure SetAmp;
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- uses WHPlaySDK;
- {$R *.dfm}
- procedure TForm1.LMDTrackBar5Track(Sender: TObject;
- ScrollCode: TScrollCode; var ScrollPos: Integer);
- begin
- dllSetAlpha(FlatSpinEditInteger1.Value,ScrollPos/1000);
- end;
- procedure TForm1.SetAmp;
- Var
- Amp:TVMR9ProcAmpControl;
- begin
- Amp.dwSize:=sizeof(Amp);
- Amp.dwFlags:=ProcAmpControl9_Brightness or
- ProcAmpControl9_Contrast or ProcAmpControl9_Hue or ProcAmpControl9_Saturation;
- Amp.Brightness:=LMDTrackBar2.Position-100;
- Amp.Contrast:=LMDTrackBar4.Position/1000;
- Amp.Hue:=LMDTrackBar3.Position-180;
- Amp.Saturation:=LMDTrackBar1.Position/1000;
- dllSetAmpControl(FlatSpinEditInteger1.Value,@Amp);
- end;
- procedure TForm1.LMDTrackBar4Track(Sender: TObject;
- ScrollCode: TScrollCode; var ScrollPos: Integer);
- begin
- SetAmp;
- end;
- procedure TForm1.FormShow(Sender: TObject);
- Var
- a:Single;
- Amp:TVMR9ProcAmpControl;
- begin
- FillChar(Amp,sizeof(Amp),0);
- Amp.dwFlags:=ProcAmpControl9_Brightness or
- ProcAmpControl9_Contrast or ProcAmpControl9_Hue or ProcAmpControl9_Saturation;
- Amp.dwSize:=sizeof(Amp);
- if dllGetAmpControl(FlatSpinEditInteger1.Value,@Amp)=1 then
- begin
- LMDTrackBar2.Position:=Round(Amp.Brightness+100);
- LMDTrackBar4.Position:=Round(Amp.Contrast*1000);
- LMDTrackBar3.Position:=Round(Amp.Hue+180);
- LMDTrackBar1.Position:=Round(Amp.Saturation*1000);
- end
- else
- begin
- LMDTrackBar2.Position:=0;
- LMDTrackBar4.Position:=0;
- LMDTrackBar3.Position:=0;
- LMDTrackBar1.Position:=0;
- LMDTrackBar1.Enabled:=false;
- LMDTrackBar2.Enabled:=false;
- LMDTrackBar3.Enabled:=false;
- LMDTrackBar4.Enabled:=false;
- end;
- if dllGetAlpha(FlatSpinEditInteger1.Value,a)=1 then
- LMDTrackBar5.Position:=Round(a*1000)
- else
- begin
- LMDTrackBar5.Enabled:=false;
- end;
- end;
- procedure TForm1.FlatSpeedButton1Click(Sender: TObject);
- begin
- LMDTrackBar4.Position:=LMDTrackBar4.MaxValue DIV 2;
- SetAMP;
- end;
- procedure TForm1.FlatSpeedButton2Click(Sender: TObject);
- begin
- LMDTrackBar3.Position:=LMDTrackBar3.MaxValue DIV 2;
- SetAMP;
- end;
- procedure TForm1.FlatSpeedButton3Click(Sender: TObject);
- begin
- LMDTrackBar1.Position:=LMDTrackBar1.MaxValue DIV 2;
- SetAMP;
- end;
- procedure TForm1.FlatSpeedButton4Click(Sender: TObject);
- begin
- LMDTrackBar2.Position:=LMDTrackBar2.MaxValue DIV 2;
- SetAMP;
- end;
- procedure TForm1.FlatSpeedButton5Click(Sender: TObject);
- begin
- LMDTrackBar5.Position:=LMDTrackBar5.MaxValue;
- dllSetAlpha(FlatSpinEditInteger1.Value,LMDTrackBar5.Position/1000);
- end;
- procedure TForm1.FlatButton1Click(Sender: TObject);
- begin
- FlatSpeedButton1.Click;
- FlatSpeedButton2.Click;
- FlatSpeedButton3.Click;
- FlatSpeedButton4.Click;
- FlatSpeedButton5.Click;
- end;
- procedure TForm1.FlatButton2Click(Sender: TObject);
- Var
- Val1,Val2:LongInt;
- begin
- DllConfig('SHOWVIDEOPROPERTY',Val1,Val2);
- end;
- end.