兄弟现在需要做一个能够显示摄像头动态画面的程序,请问有什么控件、或者是方法吗?300分相赠!!(急!!在线等!) ( 积分: 300 )

  • 主题发起人 主题发起人 hcm0790
  • 开始时间 开始时间
H

hcm0790

Unregistered / Unconfirmed
GUEST, unregistred user!
e-mail: hcm0790@sina.com
 
e-mail: hcm0790@sina.com
 
Dspack就可以了.
你也可以去找AnyQ,下载它的源代码来研究的.
www.delphifans.com上面有的.
 
我有api做的。e-mail:wuzhou127@163.com
 
好久没有上来了,我以前是做这方面的。联系我好了。

QQ15104368
 
unit Unit1;
//最简单的,用videocap,videodisp,vfw
interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Videocap,vfw;

type
TForm1 = class(TForm)
VideoCap1: TVideoCap;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
VideoCap1.DriverIndex:=0;
VideoCap1.VideoPreview:=true;
videocap1.DriverOpen:=true;
end;

end.
 
我网站上面有这方面的软件——我的多媒体摄像机——一款利用摄像头、MIC进行录音、录像、抓拍照片的小软件。有兴趣的可以下载试一试。
www.startor.cn
 
已发到你的邮箱了
 
我也需要 谁有?依妹儿:blockhea_li@163.com
 
能给我一份吗? songjian972@163.com
 
我这有利用MS的AVICAP32.DLL实现对摄像头编程的部分资料
 
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;

type
TForm1 = class(TForm)
Panel1: TPanel;
Button1: TButton;
Button2: TButton;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
hWndC : THandle;
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

const WM_CAP_START = WM_USER;
const WM_CAP_STOP = WM_CAP_START + 68;
const WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10;
const WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 11;
const WM_CAP_SAVEDIB = WM_CAP_START + 25;
const WM_CAP_GRAB_FRAME = WM_CAP_START + 60;
const WM_CAP_SEQUENCE = WM_CAP_START + 62;
const WM_CAP_FILE_SET_CAPTURE_FILEA = WM_CAP_START + 20;
const WM_CAP_SEQUENCE_NOFILE =WM_CAP_START+ 63 ;
const WM_CAP_SET_OVERLAY =WM_CAP_START+ 51 ;
const WM_CAP_SET_PREVIEW =WM_CAP_START+ 50 ;
const WM_CAP_SET_CALLBACK_VIDEOSTREAM = WM_CAP_START +6;
const WM_CAP_SET_CALLBACK_ERROR=WM_CAP_START +2;
const WM_CAP_SET_CALLBACK_STATUSA= WM_CAP_START +3;
const WM_CAP_SET_CALLBACK_FRAME= WM_CAP_START +5;
const WM_CAP_SET_SCALE=WM_CAP_START+ 53 ;
const WM_CAP_SET_PREVIEWRATE=WM_CAP_START+ 52 ;

function capCreateCaptureWindowA(lpszWindowName : PCHAR;
dwStyle : longint;x : integer;y : integer;nWidth : integer;
nHeight : integer;ParentWin : HWND;nId : integer): HWND;
STDCALL EXTERNAL 'AVICAP32.DLL';


implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
hWndC := capCreateCaptureWindowA('My Own Capture Window',WS_CHILD or WS_VISIBLE ,Panel1.Left,Panel1.Top,Panel1.Width,Panel1.Height,Form1.Handle,0);

hWndC := capCreateCaptureWindowA('My Own Capture Window',WS_CHILD or WS_VISIBLE ,Panel1.Left,Panel1.Top,Panel1.Width,Panel1.Height,Form1.Handle,0);
if hWndC <> 0 then
begin
SendMessage(hWndC, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0);
SendMessage(hWndC, WM_CAP_SET_CALLBACK_ERROR, 0, 0);
SendMessage(hWndC, WM_CAP_SET_CALLBACK_STATUSA, 0, 0);
SendMessage(hWndC, WM_CAP_DRIVER_CONNECT, 0, 0);
SendMessage(hWndC, WM_CAP_SET_SCALE, 1, 0);
SendMessage(hWndC, WM_CAP_SET_PREVIEWRATE, 66, 0);
SendMessage(hWndC, WM_CAP_SET_OVERLAY, 1, 0);
SendMessage(hWndC, WM_CAP_SET_PREVIEW, 1, 0);
end;

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if hWndC <> 0 then
begin
SendMessage(hWndC,WM_CAP_SAVEDIB,0,longint(pchar('c://test.bmp')));
end;
image1.Picture.LoadFromFile('c:/test.bmp');
end;

end.


用这个就可以搞定
 
在XP SP1+D6下测试通过
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
639
import
I
后退
顶部