Home > Back-end >  About DirectShow
About DirectShow

Time:10-01

According to the online tutorials, written in VS2013 video acquisition, found that call FindVideoPin () is undefined, excuse me what's the problem?

CodePudding user response:

C/C + + code? 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 # include & lt; VFW. H> HWND hWndC ghWndCap; Void __fastcall TfmGoodsPhotoGet: : sbCheckVideoClick (TObject * Sender) {bool bVFWFlag; Int iVFWCount; if(! BCheckVideoEnable) {//sheath maerial open hWndC=Panel8 - & gt; Handle;//create a Capture Window, which gives priority to handle to the Window hWnd ghWndCap=capCreateCaptureWindow (" the Capture Window ", WS_CHILD | WS_VISIBLE, 0,0,352,298, hWndC, 0). BVFWFlag=false; IVFWCount=0; While ((iVFWCount<1000) & amp; & (bVFWFlag==false)) {bVFWFlag=capDriverConnect (ghWndCap, 0); IVFWCount++; {} the if (bVFWFlag==true) CAPDRIVERCAPS caps; CapDriverGetCaps (ghWndCap, sizeof (caps), & amp; Caps); If (caps. FHasOverlay) capOverlay (ghWndCap, TRUE); CapPreviewScale (ghWndCap, 1); CapPreviewRate (ghWndCap, 1000/24);//set the Preview mode of display rate capPreview (ghWndCap, TRUE);//start the Preview mode bCheckVideoEnable=true; SbCheckVideo - & gt; Caption="close"; SbCapture - & gt; Enabled=true; }} else {//close the if cameras (ghWndCap) {capPreview (ghWndCap, false); CapCaptureStop (ghWndCap); CapCaptureAbort (ghWndCap); CapDriverDisconnect (ghWndCap); : : DestroyWindow (ghWndCap); GhWndCap=NULL; BCheckVideoEnable=false; SbCheckVideo - & gt; Caption="open"; SbCapture - & gt; Enabled=false; }}}//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Capture, only supplies the reference

C/C + + code? 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 void __fastcall TfmGoodsPhotoGet: : sbCaptureClick (TObject * Sender) {TJPEGImage * j=new TJPEGImage; Graphics: : TBitmap * b=new Graphics: : TBitmap; AnsiString asSaveFile; if(! BCheckVideoEnable) {lbOpInfo - & gt; Caption="sheath maerial not open"; return; } the if (ghWndCap) {int I; i=0; Try {asSaveFile=fmMain - & gt; AsPhotoDir + \ \ "photo. BMP"; CapFileSaveDIB (ghWndCap, asSaveFile c_str ()); I=1; B - & gt; LoadFromFile (asSaveFile); I=2; J - & gt; The Assign (b); J - & gt; CompressionQuality=100;//level is too high may compression error! J - & gt; Compress (); I=3; Ms_Temp - & gt; The Position=0; J - & gt; SaveToStream (ms_Temp); I=4; Ms_Temp - & gt; The Position=0; JpgTemp - & gt; LoadFromStream (ms_Temp); I=5; ImgComm - & gt; Picture - & gt; The Assign (jpgTemp); I=6; LbOpInfo - & gt; Caption=""; } the catch (... ) {lbOpInfo - & gt; Caption="capture failed!" + AnsiString (I); }} else {lbOpInfo - & gt; Caption="not open"; } the delete b; The delete j; }//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

CodePudding user response:

 

#include HWND hWndC ghWndCap; Void __fastcall TfmGoodsPhotoGet: : sbCheckVideoClick (TObject * Sender) {bool bVFWFlag; Int iVFWCount; if(! BCheckVideoEnable) {//sheath maerial open hWndC=Panel8 - & gt; Handle;//create a Capture Window, which gives priority to handle to the Window hWnd ghWndCap=capCreateCaptureWindow (" the Capture Window ", WS_CHILD | WS_VISIBLE, 0,0,352,298, hWndC, 0). BVFWFlag=false; IVFWCount=0; While ((iVFWCount<1000) & amp; & (bVFWFlag==false)) {bVFWFlag=capDriverConnect (ghWndCap, 0); IVFWCount++; {} the if (bVFWFlag==true) CAPDRIVERCAPS caps; CapDriverGetCaps (ghWndCap, sizeof (caps), & amp; Caps); If (caps. FHasOverlay) capOverlay (ghWndCap, TRUE); CapPreviewScale (ghWndCap, 1); CapPreviewRate (ghWndCap, 1000/24);//set the Preview mode of display rate capPreview (ghWndCap, TRUE);//start the Preview mode bCheckVideoEnable=true; SbCheckVideo - & gt; Caption="close"; SbCapture - & gt; Enabled=true; }} else {//close the if cameras (ghWndCap) {capPreview (ghWndCap, false); CapCaptureStop (ghWndCap); CapCaptureAbort (ghWndCap); CapDriverDisconnect (ghWndCap); : : DestroyWindow (ghWndCap); GhWndCap=NULL; BCheckVideoEnable=false; SbCheckVideo - & gt; Caption="open"; SbCapture - & gt; Enabled=false; }}}//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Capture, only supplies the reference

Void __fastcall TfmGoodsPhotoGet: : sbCaptureClick (TObject * Sender) {TJPEGImage * j=new TJPEGImage; Graphics: : TBitmap * b=new Graphics: : TBitmap; AnsiString asSaveFile; if(! BCheckVideoEnable) {lbOpInfo - & gt; Caption="sheath maerial not open"; return; } the if (ghWndCap) {int I; i=0; Try {asSaveFile=fmMain - & gt; AsPhotoDir + \ \ "photo. BMP"; CapFileSaveDIB (ghWndCap, asSaveFile c_str ()); I=1; B - & gt; LoadFromFile (asSaveFile); I=2; J - & gt; The Assign (b); J - & gt; CompressionQuality=100;//level is too high may compression error! J - & gt; Compress (); I=3; Ms_Temp - & gt; The Position=0; J - & gt; SaveToStream (ms_Temp); I=4; Ms_Temp - & gt; The Position=0; JpgTemp - & gt; LoadFromStream (ms_Temp); I=5; ImgComm - & gt; Picture - & gt; The Assign (jpgTemp); I=6; LbOpInfo - & gt; Caption=""; } the catch (... ) {lbOpInfo - & gt; Caption="capture failed!" + AnsiString (I); }} else {lbOpInfo - & gt; Caption="not open"; } the delete b; The delete j; }//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

CodePudding user response:

nullnull
  • Related