06-05-2015 12:40 AM
Hey there,
I'm using the vf32.lib (+gdi32.lib) to connect a webcam to cvi. I use the command:
capCreateCaptureWindow("live capture", WS_POPUP|WS_CAPTION, 0, 0, WIDTH, HEIGHT, 0, 0)
to create a capture window. But its a popup window. I want to integrate the webcam preview into a canvas or something else on my panel in CVI. Is there any change to do it? I tried with
capCreateCaptureWindow("live capture", WS_CHILD | WS_VISIBLE, 0, 0, WIDTH, HEIGHT, panelHandle??, 0)
but it doesnt work ^^.
06-07-2015 03:57 PM
How did you retrieve the panelHandle? If you just pass in the LabWindows CVI panel handle that can't work since that is something completely different from a Windows window handle. You first need to retrieve the Windows window handle from the panelHandle with
HANDLE handle;
GetPanelAttribute (panelHandle, ATTR_SYSTEM_WINDOW_HANDLE, &handle);
06-08-2015 01:12 AM
Thanks very much 🙂 it works!!!!
My next problem: I want to draw a transparent box over the video, because the user should choose a portion of the webcam picture that is used for image processing. In the past I drawn the a single webcam image on a canvas and the transparent box over it.
07-21-2016 03:29 AM
Nachtrag:
Es hat ja bekanntlich funktioniert, jedoch so:
int WHdlVideo; GetPanelAttribute(PHdlMain, ATTR_SYSTEM_WINDOW_HANDLE, &WHdlVideo);
und dann mit meiner Kamer Library (TheImagingSource)
IC_SetHWnd(TISCam_Hdl, (HWND)WHdlVideo);
Sachen ins Bilde reinmalen mit:
PAINTSTRUCT ps; HDC hdc = BeginPaint(hwnd, &ps); // All painting occurs here, between BeginPaint and EndPaint. FillRect(hdc, &ps.rcPaint, (HBRUSH) (COLOR_WINDOW+1)); EndPaint(hwnd, &ps);
usw