Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 29-11-2008
Avatar de cHackAll
[cHackAll] cHackAll is offline
Baneado?
 
Registrado: oct 2006
Posts: 2.159
Poder: 22
cHackAll Va por buen camino
Código Delphi [-]
function capCreateCaptureWindowA(lpWindowName: PChar; dwStyle, X, Y, nWidth, nHeight, hWnd, nID: Integer): Cardinal; stdcall external 'avicap32';
function capGetDriverDescriptionA(wDriverIndex: Word; lpszName: PChar; cbName: Cardinal; lpszVer: PChar; cbVer: Cardinal): LongBool; stdcall external 'avicap32';

function GetCapture(lpszName: PChar; hWnd: Integer): Cardinal;
var
 DeviceName: array [0..31] of Char;
 Rect: TRect;
begin
 Result := 0;
 repeat if capGetDriverDescriptionA(Result, @DeviceName, SizeOf(DeviceName), nil, 0) and (lstrcmp(@DeviceName, lpszName) = 0) then
  begin GetClientRect(hWnd, Rect);
   hWnd := capCreateCaptureWindowA('cap.wnd', WS_CHILD or WS_VISIBLE, 0, 0, Rect.Right, Rect.Bottom, hWnd, 0);
   if hWnd <> 0 then
    begin
     SendMessage(hWnd, WM_USER + 10{WM_CAP_DRIVER_CONNECT}, Result, 0);
     SendMessage(hWnd, WM_USER + 53{WM_CAP_SET_SCALE}, 1, 0);
     SendMessage(hWnd, WM_USER + 52{WM_CAP_SET_PREVIEWRATE}, 33, 0);
     SendMessage(hWnd, WM_USER + 51{WM_CAP_SET_OVERLAY}, 0, 0);
     SendMessage(hWnd, WM_USER + 50{WM_CAP_SET_PREVIEW}, 1, 0);
     ShowWindow(hWnd, SW_SHOW);
    end;
   Result := hWnd;
   Exit;
  end;
  Inc(Result);
 until Result = 10;
 Result := 0;
end;

procedure Capture(const hCapture: Cardinal; const lpFileName: PChar);
begin
 SendMessage(hCapture, WM_USER + 60{WM_CAP_GRAB_FRAME}, 0, 0);
 SendMessage(hCapture, WM_USER + 25{WM_CAP_FILE_SAVEDIB}, 0, Integer(lpFileName));
 SendMessage(hCapture, WM_USER + 50{WM_CAP_SET_PREVIEW}, 1, 0); // Restart preview
end;

var hCapture: Cardinal;

procedure TForm1.Button1Click(Sender: TObject);
begin
 Capture(hCapture, 'c:\archivo.bmp');
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
 hCapture := GetCapture('Creative WebCam NX Pro (VFW)', Panel1.Handle);
end;
__________________
RTFM > STFW > Foro > Truco > Post > cHackAll > KeBugCheckEx
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
tjvavicap como capturar una foto ? martita Gráficos 2 05-03-2008 17:33:42
poner foto en el centro de otra foto kapullok_2006 Gráficos 1 22-10-2007 17:52:10
Foto para la posteridad Bicho Linux 3 05-10-2007 00:35:44
componente para capturar imagen de camara web perico OOP 3 02-02-2007 22:05:56
architect dvd 3.0 entre foto y foto tulajvs Gráficos 2 06-11-2006 10:11:02


La franja horaria es GMT +2. Ahora son las 17:39:28.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi