请大家救救我吧!我写了一个多执行绪的程式,用来判断影像是否有移动,只要移动就会录影
不动就停止录影,但是一但录影的时候,就不能动作,不能比较图片,请大家救救我吧
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "vfw.h"
#include "jpeg.hpp"
#include <Clipbrd.hpp>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
HWND hCapWnd;
BITMAPINFO bmi;
CAPTUREPARMS CaptureParms;
int width,height,ss,mm,hh,dd;
bool flag;
double compare;
static double basic;
static int cout;
TMyThread *MyThread,*MyThread1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
width=320;
height=240;
hCapWnd = capCreateCaptureWindow("My Capture Window", WS_CHILD | WS_VISIBLE,0, 0, width, height,Form1->Panel1->Handle, 0 );
bool a = false;
for( int i = 0; i < 10; i++ )
{
a = capDriverConnect( hCapWnd, i );
if( a ) break;
}
if( !a )
{
ShowMessage("摄影机连接失败..");
}
capOverlay(hCapWnd, true);
capPreview(hCapWnd,true);
capPreviewScale(hCapWnd,true);
capPreviewRate(hCapWnd, 1000/30);
capGetVideoFormat(hCapWnd, &bmi, sizeof(BITMAPINFO));
bmi.bmiHeader.biWidth=width;
bmi.bmiHeader.biHeight=height;
SetWindowPos(hCapWnd, 0, 0, 0, bmi.bmiHeader.biWidth,bmi.bmiHeader.biHeight,0);
Form1->Panel1->ClientHeight=bmi.bmiHeader.biHeight;
Form1->Panel1->ClientWidth=bmi.bmiHeader.biWidth;
basic=0;
compare=0;
flag=false;
}
//---------------------------------------------------------------------------
_fastcall TMyThread::TMyThread(void):TThread(true)
{
Resume();
}
void __fastcall TM ..
访客只能看到部份内容,免费 加入会员 或由脸书 Google 可以看到全部内容