//--------------------------------------------------------------------------- #include #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "VidGrab" #pragma resource "*.dfm" TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::startClick(TObject *Sender) { VideoGrabber1->StartPreview(); VideoGrabber2->StartPreview(); } //--------------------------------------------------------------------------- void __fastcall TForm1::FormCreate(TObject *Sender) { VideoGrabber1->VideoDevice = 0; VideoGrabber1->VideoSource = vs_VideoCaptureDevice; VideoGrabber1->BurstType = fc_TBitmap; VideoGrabber1->BurstMode = True; VideoGrabber1->RecordingTimer = TRecordingTimer (2); // VideoGrabber1->RecordingTimerInterval = StrToIntDef (edtRecordingTimerInterval->Text, 0); VideoGrabber1->RecordingTimerInterval=3; VideoGrabber1->FrameRate=100.0; VideoGrabber1->UseNearestVideoSize(640,480,false); VideoGrabber1->StoragePath="D:\Temp"; VideoGrabber1->VideoSubtypeIndex("Mono 8"); // Memo1->Lines->Add ("current frame rate: " + FormatFloat ("0.00", VideoGrabber1->CurrentFrameRate) + " fps."); } //--------------------------------------------------------------------------- void __fastcall TForm1::recordingClick(TObject *Sender) { VideoGrabber1->StartRecording(); } //--------------------------------------------------------------------------- void __fastcall TForm1::stopClick(TObject *Sender) { VideoGrabber1->StopRecording(); VideoGrabber1->StartPreview(); } //--------------------------------------------------------------------------- void __fastcall TForm1::Memo1Change(TObject *Sender) { // String str=IntToStr(); // Memo1->Lines->Add ("current frame rate: " + FormatFloat ("0.00", VideoGrabber1->CurrentFrameRate) + " fps."); } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { Memo1->Lines->Add ("current frame rate: " + FormatFloat ("0.00", VideoGrabber1->CurrentFrameRate) + " fps."); } //---------------------------------------------------------------------------