⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drvedit.pas

📁 Tvideocap组件,本人在安装的时候卸载掉imageen才能安装上。
💻 PAS
字号:
unit drvedit;

interface



procedure Register;

implementation

 uses classes,DesignIntf,sysutils,vfw,videocap,DesignEditors;

// Property Editor for driver selection   in Video-Cap
type TDrivereditor= class (TPropertyEditor)
  function GetAttributes:TPropertyAttributes;override;
  procedure GetValues(Proc: TGetStrProc);override;
  function GetValue:string;override;
  procedure SetValue(const Value: string);override;
end;

function TDriverEditor.GetAttributes:TPropertyAttributes;
begin
 result :=[paRevertable,paValueList];
end;


procedure TDriverEditor.GetValues(Proc: TGetStrProc);
var i:integer;
    name:array[0..80] of char;
    ver :array[0..80] of char;
    s:string;

begin
 for i:= 0 to 9 do
  begin
   if capGetDriverDescription( i,name,80,ver,80) then
      s:=strpas(name)
   else
      s:='' ;
   proc(s);
  end;

end;



function TDriverEditor.GetValue:string;

var  n:array[0..80] of char;
     ver :array[0..80] of char;
     s:string;


begin
 with Getcomponent(0) as TVideoCap do
   begin
    if capGetDriverDescription( DriverIndex,n,80,ver,80) then
      s:=strpas(n)
    else
      s:='' ;
   end;
   result:= s;               //fVideoDrivername;
end;



procedure TDriverEditor.SetValue(const Value: string);
begin
  with Getcomponent(0) as TVideoCap do
    SetDrivername( value) ;
  Modified;
end;






procedure Register;
begin

  RegisterPropertyEditor(TypeInfo(string),TVideoCap,'DriverName',TDriverEditor);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -