LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

vfw32 (video for windows) put capture window into a panel?

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 ^^.

0 Kudos
Message 1 of 4
(5,188 Views)

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);

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 4
(5,157 Views)

Thanks very much 🙂 it works!!!!Smiley Very Happy

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.

0 Kudos
Message 3 of 4
(5,145 Views)

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

 

0 Kudos
Message 4 of 4
(3,850 Views)