Autor Beitrag
rjan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 40

Win XP, WIN 2000, Win 98, Win 95, Win 3.11
D5 Stand /D7 enterp/2k5 pers.
BeitragVerfasst: Mi 25.05.05 13:28 
Tach mal wieder ...

ich habn capture programm im netz gefunden...

ABER EIN PROBLEM:::

und zwar hab ich eine webcam und ne tv karte und ich will das bild der wcam sehen ...

jedoch zeigt mir das programm das bild der TV karte. . . . das nervt und ich bin mit meinem 'griechisch' am ende....

bitte helft mir


hier der quelltext

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
unit camtest1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Timer1: TTimer;
    GroupBox1: TGroupBox;
    Panel1: TPanel;
    Button2: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    TrackBar1: TTrackBar;
    Label4: TLabel;
    StatusBar1: TStatusBar;
    procedure Button1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure TrackBar1Change(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
    VideoHandle: HWND;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

const
  WM_CAP_START = WM_USER;
  WM_CAP_DRIVER_CONNECT = WM_USER+10;
  WM_CAP_DRIVER_DISCONNECT = WM_USER+11;
  WM_CAP_DRIVER_GET_NAMEA = WM_USER+12;
  WM_CAP_DRIVER_GET_VERSIONA = WM_USER+13;
  WM_CAP_GRAB_FRAME = WM_USER+60;
  WM_CAP_SEQUENCE = WM_USER+62;

function capCreateCaptureWindow(lpszWindowName: PChar; dwStyle,x,y,nWidth,nHeight: Integer;
  hWndParent: HWND; nID: Integer): HWND; stdcall; external 'avicap32.dll' name 'capCreateCaptureWindowA';

procedure TForm1.Button1Click(Sender: TObject);
var
  buf: array[0..80] of char;
begin
  VideoHandle:= capCreateCaptureWindow('Video1',WS_VISIBLE or WS_CHILD,0,0,160,
    120,Panel1.Handle,0);
  if VideoHandle = 0 then begin
    StatusBar1.Panels[0].Text:= '  Capture Fehler';
    Exit;
  end;
  if SendMessage(VideoHandle,WM_CAP_DRIVER_CONNECT,0,0) = 0 then begin
    StatusBar1.Panels[0].Text:= '  Verbindung zum Capture Treiber gescheitert';
    DestroyWindow(VideoHandle);
    VideoHandle:= 0;
    Exit;
  end;
  FillChar(buf,SizeOf(buf),0);
  SendMessage(VideoHandle,WM_CAP_DRIVER_GET_NAMEA,80,integer(Addr(buf)));
  Label2.Caption:= StrPas(buf);
  FillChar(buf,SizeOf(buf),0);
  SendMessage(VideoHandle,WM_CAP_DRIVER_GET_VERSIONA,40,integer(Addr(buf)));
  Label3.Caption:= StrPas(buf);
  Timer1.Enabled:= True;
  Button1.Enabled:= False;
  Button2.Enabled:= True;
  StatusBar1.Panels[0].Text:= '  Aktiv';
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  SendMessage(VideoHandle,WM_CAP_GRAB_FRAME,0,0);
  StatusBar1.Panels[1].Text:= Format('%.1f fps  ',[1000/Timer1.Interval]);
end;

procedure TForm1.TrackBar1Change(Sender: TObject);
begin
  Timer1.Interval:= 20+70*TrackBar1.Position;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  Timer1.Enabled:= False;
  Button1.Enabled:= True;
  Button2.Enabled:= False;
  SendMessage(VideoHandle,WM_CAP_DRIVER_DISCONNECT,0,0);
  DestroyWindow(VideoHandle);
  VideoHandle:= 0;
  StatusBar1.Panels[0].Text:= '  Inaktiv';
  StatusBar1.Panels[1].Text:= '0 fps  ';
end;

end.


www.coding-board.de/...howthread.php?t=6329


Zuletzt bearbeitet von rjan am Mi 25.05.05 13:49, insgesamt 1-mal bearbeitet
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 25.05.05 13:30 
Da wirst du irgendwo im Programm die Quelle umstellen müssen. Wo gibt's das Programm denn, dann kann ich dir vielleicht suchen helfen, wenn's Freeware ist. ;)

//EDIT: Oooops. Falsch verstanden. Der Code war vorhin noch nicht drin. ;)
rjan Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 40

Win XP, WIN 2000, Win 98, Win 95, Win 3.11
D5 Stand /D7 enterp/2k5 pers.
BeitragVerfasst: Mi 25.05.05 13:53 
Haste ne idee WeBsPaCe
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 25.05.05 20:24 
Ich werd's mir auf jeden Fall mal ansehen. Das interessiert mich nämlich auch. ;)

//EDIT: Also, da ich keine 2 Videodevices habe, kann ich das alles nicht testen, aber schau mal hier:
www.delphipraxis.net/post217156.html
www.delphi-forum.de/...e3759340b69cd5b53e9c
und vor allem auch hier:
msdn.microsoft.com/l...riverdescription.asp

;)
rjan Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 40

Win XP, WIN 2000, Win 98, Win 95, Win 3.11
D5 Stand /D7 enterp/2k5 pers.
BeitragVerfasst: Do 26.05.05 14:59 
TACH AUCH AN ALLE ich hab ne Lösung . . .

WER entwickeln will muss das auch tun . . .

Einzige einschränkung die ich beachtet sehen möchte IST:

Jeder versucht die Bilder in mpg-filmen zu Speichern (sofern zeitlich oder könnerisch möglich!)
Einloggen, um Attachments anzusehen!
Calyptus
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 386

Win Xp Prof
D3, D6 Pers, D7 Ent
BeitragVerfasst: Mo 30.05.05 17:32 
Das ganze tut bei mir ohne Probleme. Jetzt würde ich das Bild aber gerne weiterverarbeiten (als Bitmap). Ich bekomms aber nur auf das Panel oder auf die Form. Wie kann ichs irgendwie in ein Bitmap bekommen?

_________________
Luft- und Raumfahrtechnik an der Uni Stuttgart
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mo 30.05.05 17:34 

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
rjan Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 40

Win XP, WIN 2000, Win 98, Win 95, Win 3.11
D5 Stand /D7 enterp/2k5 pers.
BeitragVerfasst: Mi 01.06.05 17:14 
Ich hab nun nur noch das Problem , dass ich das panel.handle in einen film konvertieren will.....