Yo lo tengo hecho para builder 3.0Te paso el archivo .cpp y el .h
ARCHIVO CPP
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <vfw.h>
#include "Captura_Y_saca_Foto.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFicha_Principal *Ficha_Principal;
HWND w;
//---------------------------------------------------------------------------
__fastcall TFicha_Principal::TFicha_Principal(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFicha_Principal::btnStartClick(TObject *Sender)
{
w = capCreateCaptureWindow("Mi Video", WS_CHILD | WS_VISIBLE,1, 1, 320, 240, Panel1->Handle, 0);
int iCapDrv;
for (iCapDrv=0; iCapDrv<10; iCapDrv++)
if (capDriverConnect(w, iCapDrv))
break;
if (iCapDrv >= 10)
throw Exception("Error: no se encontraron dispositivos.");
// Aquí podriamos llamar a la siguiente función
// para seleccionar la resolución en tiempo de ejecución
// capDlgVideoFormat(w);
capPreview(w, true);
capPreviewScale(w, true);
capPreviewRate(w, 40);
}
//---------------------------------------------------------------------------
void __fastcall TFicha_Principal::btnSaveFrameClick(TObject *Sender)
{
String FileName = ExtractFilePath(Application->ExeName) + "foto.bmp";
capFileSaveDIB(w, FileName.c_str());
}
//---------------------------------------------------------------------------
void __fastcall TFicha_Principal::FormDragOver(TObject *Sender,
TObject *Source, int X, int Y, TDragState State, bool &Accept)
{
Accept=Source->ClassNameIs("Panel1");
}
//-------------------------------------------
--------------------------------
ARCHIVO .H
//---------------------------------------------------------------------------
#ifndef Captura_Y_saca_FotoH
#define Captura_Y_saca_FotoH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
//---------------------------------------------------------------------------
class TFicha_Principal : public TForm
{
__published: // IDE-managed Components
TPanel *Panel1;
TButton *btnStart;
TButton *btnSaveFrame;
void __fastcall btnStartClick(TObject *Sender);
void __fastcall btnSaveFrameClick(TObject *Sender);
void __fastcall FormDragOver(TObject *Sender, TObject *Source, int X,
int Y, TDragState State, bool &Accept);
private: // User declarations
public: // User declarations
__fastcall TFicha_Principal(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TFicha_Principal *Ficha_Principal;
//---------------------------------------------------------------------------
#endif
COMO PUEDES APRECIAR HAY UN PANEL DONDE SE REPRESENTA LA IMAGEN, Y DOS BOTONES:UNO DE INICIO Y OTRO PARA SACAR UNA FOTO