Registriert seit: 28. Mai 2004
Ort: Hamburg
98 Beiträge
Delphi 2005 Personal
|
Re: Ein einzelnes Bild von der Webcam lokal als jpg speicher
23. Jul 2006, 00:54
Ich hab leider nur was _mit_ Zwischenablage
Delphi-Quellcode:
uses
Vfw;
function capCreateCaptureWindow(lpszWindowName: LPCSTR; dwStyle: DWORD; x, y, nWidth, nHeight: integer; hwndParent: HWND; nID: integer): HWND; stdcall; external 'AVICAP32.DLL' name 'capCreateCaptureWindowA';
procedure TForm1.FormCreate(Sender: TObject);
const
WM_CAP_DRIVER_CONNECT = WM_USER + 10;
WM_CAP_SET_PREVIEW = WM_USER + 50;
WM_CAP_SET_OVERLAY = WM_USER + 51;
WM_CAP_SET_PREVIEWRATE = WM_USER + 52;
begin
myhandle := capCreateCaptureWindow('Video', WS_CHILD + WS_VISIBLE, 0, 0, 640, 480, Panel1.Handle, 1);
SendMessage(myhandle, WM_CAP_DRIVER_CONNECT, 0, 0);
SendMessage(myhandle, WM_CAP_SET_PREVIEWRATE, 500, 0);
sendMessage(myhandle, WM_CAP_SET_OVERLAY, 1, 0);
SendMessage(myhandle, WM_CAP_SET_PREVIEW, 1, 0);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
img: TPicture;
const
WM_CAP_GRAB_FRAME_NOSTOP = WM_USER + 61;
WM_CAP_EDIT_COPY = WM_USER + 30;
begin
SendMessage(myhandle, WM_CAP_GRAB_FRAME_NOSTOP, 1, 0);
SendMessage(myhandle, WM_CAP_EDIT_COPY, 1, 0);
img := TPicture.Create;
try
img.LoadFromClipboardFormat(cf_Bitmap, ClipBoard.GetAsHandle(cf_Bitmap), 0);
[...]
finally
img.Free;
end;
end;
The Double-Crunch-Peanuts!
SwapIt:
|
|
Zitat
|