DirectShowMBS, mousedown event on live preview

Hi, starting from the example “PlayCap with frame grabber”,
I am trying to intercept the mouse click on the live stream of the camera. How can I do this?

The example uses a Canvas to show picture. So you could add a mouseDown event to the canvas on Window1.

Hi Christian.
I tryed that. the preview of the video is like “superimposed” on the canvas, therefore the click is not intercepted.

Maybe the problem is here?

vw.WindowStyle = BitwiseOr(vw.WS_CHILD, vw.WS_CLIPCHILDREN) 'Set video window style

And if you drop another canvas over the canvas used to host the view?

I just tryed that also. Don’t work. Because the sequence of images, really, is not showed in Canvas, but in a window overlayed on the canvas. So, if you add a second Canvas or Rectangle, that window is always on the control… :frowning:

Did you assign messageDrain property for the video window?
This tells it where to send mouse and keyboard events.

We’ll also add properties to assign owner and messageDrain with a control instead of a window.

yes! messageDrain was the solution! :slight_smile:

thanks

Great. You can later change code to use our new Control properties and position it relative to canvas instead of the window.

I solved using a different hidden window, with a reference to my Canvas :wink: