?? unit1.~pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, RYENVLib_TLB, ComCtrls,ActiveX, RYELib_TLB;
type
prye_custom_mode=^rye_custom_mode;
rye_custom_mode=record
nflashmode:Integer; //flash mode
nspotmacro:Integer; //spot¯o
//RYE_CUSTOM_MACOR_SPOT_OF
//RYE_CUSTOM_MACRO_ON
//RYE_CUSTOM_SPOT_ON
nfocal_length_numerator:Integer; //focal length* nfocal_length_denomonator
nfocal_length_denomonator:Integer; //10
naperture_numerator:Integer; //aperture value * naperture_denominator
naperture_denominator:Integer; //10
nexposuretime:Integer; //exposure time in microsends
nexposbias_numerator:Integer; //exposure bias value * nexpobias_denominator
nexposbias_denominator:Integer; //10
nfocusmode:integer; //focus mode
//RYE_CUSTOM_AUTO
//RYE_CUSTOM_MANUAL
nwhiteblanacemode:Integer;//white blanace mode
nisomode:Integer; //iso speed rate value
nezoom:Integer;//digital zoom mode
//RYE_CUSTOM_EZOOM_OFF
//RYE_CUSTOM_EZOOM_ON
nfunctionmode:Integer;//function mode
//RYE_CUSTOM_FUNC_OFF
//RYE_CUSTOM_FUNC_MONO
//RYE_CUSTOM_FUNC_SEPIA
//RYE_CUSTOM_FUNC_WBOARD
//RYE_CUSTOM_FUNC_BBOARD
nresolutionmode:Integer;//resolution mode
//RYE_CUSTOM_RESO_HQ
//RYE_CUSTOM_RESO_SHQ
//RYE_CUSTOM_RESO_SQ1
//RYE_CUSTOM_RESO_SQ2
//RYE_CUSTOM_RESO_TIFF
nprogrammode:Integer;//program mode
//RYE_CUSTOM_PROGRAM_MANUAL=1
//RYE_CUSTOM_PROGRAM_APERTURE_PRIORITY=3
//RYE_CUSTOM_PROGRAM_SHUTTER_PRIORITY
end;
type
TForm1 = class(TForm)
btn1: TButton;
stat1: TStatusBar;
Label1: TLabel;
edt1: TEdit;
btn2: TButton;
trckbr1: TTrackBar;
btn3: TButton;
btn4: TButton;
rynvcntrlry1: TRye;
procedure btn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure btn2Click(Sender: TObject);
procedure btn3Click(Sender: TObject);
procedure btn4Click(Sender: TObject);
procedure trckbr1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
num:Integer;
lcdon:Boolean;
oldpara,newpara:prye_custom_mode;
implementation
{$R *.dfm}
procedure TForm1.btn1Click(Sender: TObject);
var
count:Integer;
begin
rynvcntrlry1.propFlash[0]:=0;
rynvcntrlry1.propResolution[0]:=1;
rynvcntrlry1.Capture(0);
count:=rynvcntrlry1.PropPicCount[0];
edt1.Text:=IntToStr(count);
rynvcntrlry1.SetLcdMode(0,2);
lcdon:=true;
// rynvcntrlry1.DisConnect(0);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
lcdon:=False;
if rynvcntrlry1.InitControl=0 then
stat1.Panels[0].Text:='檢測到數(shù)碼相機(jī)';
num:=rynvcntrlry1.PropCameraCount;
if num<>0 then stat1.Panels[1].Text:='數(shù)量:'+inttostr(num);
if rynvcntrlry1.Connect(0)<>0 then
ShowMessage('連接錯(cuò)誤!');
end;
procedure TForm1.btn2Click(Sender: TObject);
begin
if lcdon then
rynvcntrlry1.SetLcdMode(0,1)
else
rynvcntrlry1.SetLcdMode(0,2);
lcdon:=not lcdon;
end;
procedure TForm1.btn3Click(Sender: TObject);
var
bright:Integer;
// buff:OleVariant;
begin
// New(oldpara);
// if rynvcntrlry1.Connect(0)=0 then
// ShowMessage('ok');
// buff:=VarArrayCreate([0,256],varByte);
// VarArrayUnlock(buff);
// rynvcntrlry1.GetCustomValue(0,buff);
// if rynvcntrlry1.Connect(0)=0 then
// rynvcntrlry1.propFocusPosition[0]:=20;
// rynvcntrlry1.DisConnect(0);
bright:=rynvcntrlry1.propOpticalZoom[0];
ShowMessage(IntToStr(bright));
// Dec(bright);
// if rynvcntrlry1.InitControl=0 then
// rynvcntrlry1.propOpticalZoom[0]:=90;
// rynvcntrlry1.Preview(0);
// rynvcntrlry1.DisConnect(0);
end;
procedure TForm1.btn4Click(Sender: TObject);
var
bright:Integer;
begin
bright:=rynvcntrlry1.propOpticalZoom[0];
Dec(bright);
if rynvcntrlry1.InitControl=0 then
rynvcntrlry1.propOpticalZoom[0]:=bright;
end;
procedure TForm1.trckbr1Change(Sender: TObject);
//var
// bright:Integer;
begin
// bright:=rynvcntrlry1.propOpticalZoom[0];
// if rynvcntrlry1.InitControl=0 then
rynvcntrlry1.propOpticalZoom[0]:=trckbr1.Position;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -