unit Unit
interface
uses
Windows
Dialogs
type
TForm
Panel
Button
Button
Button
Button
Button
procedure Button
procedure Button
procedure Button
procedure Button
procedure Button
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
hWndC : THandle;
public
{ Public declarations }
end;
var
Form
const WM_CAP_START = WM_USER;
const WM_CAP_STOP = WM_CAP_START +
const WM_CAP_DRIVER_CONNECT = WM_CAP_START +
const WM_CAP_DRIVER_DISCONNECT = WM_CAP_START +
const WM_CAP_SAVEDIB = WM_CAP_START +
const WM_CAP_GRAB_FRAME = WM_CAP_START +
const WM_CAP_SEQUENCE = WM_CAP_START +
const WM_CAP_FILE_SET_CAPTURE_FILEA = WM_CAP_START +
const WM_CAP_SEQUENCE_NOFILE =WM_CAP_START+
const WM_CAP_SET_OVERLAY =WM_CAP_START+
const WM_CAP_SET_PREVIEW =WM_CAP_START+
const WM_CAP_SET_CALLBACK_VIDEOSTREAM = WM_CAP_START +
const WM_CAP_SET_CALLBACK_ERROR=WM_CAP_START +
const WM_CAP_SET_CALLBACK_STATUSA= WM_CAP_START +
const WM_CAP_SET_CALLBACK_FRAME= WM_CAP_START +
const WM_CAP_SET_SCALE=WM_CAP_START+
const WM_CAP_SET_PREVIEWRATE=WM_CAP_START+
function capCreateCaptureWindowA(lpszWindowName : PCHAR;
dwStyle : longint;x : integer;y : integer;nWidth : integer;
nHeight : integer;ParentWin : HWND;nId : integer): HWND;
STDCALL EXTERNAL
implementation
{$R *
procedure TForm
begin
hWndC := capCreateCaptureWindowA(
hWndC := capCreateCaptureWindowA(
if hWndC <>
begin
SendMessage(hWndC
SendMessage(hWndC
SendMessage(hWndC
SendMessage(hWndC
SendMessage(hWndC
SendMessage(hWndC
SendMessage(hWndC
SendMessage(hWndC
end;
end;
procedure TForm
begin
if hWndC <>
SendMessage(hWndC
hWndC :=
end;
end;
procedure TForm
begin
if hWndC <>
SendMessage(hWndC
end;
end;
procedure TForm
begin
if hWndC <>
begin
SendMessage(hWndC
SendMessage(hWndC
end;
end;
procedure TForm
begin
if hWndC <>
SendMessage(hWndC
end;
end;
procedure TForm
begin
if hWndC <>
SendMessage(hWndC
end;
end;
end
如果電腦沒有攝像頭
當然可以
關於攝像頭編程
好了
From:http://tw.wingwit.com/Article/program/Delphi/201311/24709.html