用攝像頭拍照的問題 ( 积分: 100 )

  • 主题发起人 主题发起人 takdick
  • 开始时间 开始时间
T

takdick

Unregistered / Unconfirmed
GUEST, unregistred user!
我用以下代碼實現了用攝像頭拍照的功能,但保存下來的圖像文件質量很差,容量只有70kb,但用另一軟件(沒有該源碼)保存下來的圖像卻清晰的多,容量達300kb,請問如何用代碼設定為最大的分辨率?
hWndC := capCreateCaptureWindowA('My Own Capture Window',WS_CHILD or WS_VISIBLE ,0,0,1,1,Form1.Handle,0);
if hWndC <> 0 then
begin
SendMessage(hWndC, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0);
SendMessage(hWndC, WM_CAP_SET_CALLBACK_ERROR, 0, 0);
SendMessage(hWndC, WM_CAP_SET_CALLBACK_STATUSA, 0, 0);
SendMessage(hWndC, WM_CAP_DRIVER_CONNECT, 0, 0);
SendMessage(hWndC, WM_CAP_SET_SCALE, 1, 0);
SendMessage(hWndC, WM_CAP_SET_PREVIEWRATE, 66, 0);
SendMessage(hWndC, WM_CAP_SET_OVERLAY, 1, 0);
SendMessage(hWndC, WM_CAP_SET_PREVIEW, 1, 0);
SendMessage(hWndC,WM_CAP_SAVEDIB,0,longint(pchar('C:/cam.bmp')));
 
后退
顶部