关于摄像头控制视频显示区域的问题?
设备:普通的摄像头
打开摄像头的代码如下:
hWnd := capCreateCaptureWindowA('My Own Capture Window',WS_CHILD or WS_VISIBLE ,bx,by,Width,Height,formhWnd,0);
hWnd := capCreateCaptureWindowA('My Own Capture Window',WS_CHILD or WS_VISIBLE ,bx,by,Width,Height,formhWnd,0);
if hWnd <> 0 then
begin
SendMessage(hWnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0);
SendMessage(hWnd, WM_CAP_SET_CALLBACK_ERROR, 0, 0);
SendMessage(hWnd, WM_CAP_SET_CALLBACK_STATUSA, 0, 0);
SendMessage(hWnd, WM_CAP_DRIVER_CONNECT, 0, 0);
SendMessage(hWnd, WM_CAP_SET_SCALE, 1, 0);
SendMessage(hWnd, WM_CAP_SET_PREVIEWRATE, 66, 0);
SendMessage(hWnd, WM_CAP_SET_OVERLAY, 1, 0);
SendMessage(hWnd, WM_CAP_SET_PREVIEW, 1, 0);
end;
现在我想做到这个效果:通过控制 bx,by,width,height 来控制显示的视频界面,但是这样写
没有达到目的,每次改变bx,by,width,height整个屏幕会自动自适应大小的。