jacobbo / WebEye

WebEye is a collection of .NET controls.
190 stars 132 forks source link

Flip video horizontally #53

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hello,

Is there a way to flip the video so that the image displays as a mirror image?

I've been unable to achieve this effect through WPF render transforms and even if I have to modify the source code and use a custom DLL I would.

Attempting to modify the GetCurrentImage method, the image.RotateFlip did not change anything with the on screen image.

Can this be done through modifying your source code or some other method?

Thank you, Michael

jacobbo commented 5 years ago

Hi Michael, is it WebCameraControl?

ghost commented 5 years ago

Yes, the WebCameraControl.

jacobbo commented 5 years ago

You'll need to modify the DirectShow part of the control to achieve this. The part resides in DirectShowFacade.cpp file. The idea is to use the IVMRMixerControl interface to switch the VMR to so called 'mixing' mode and then flip the output rectangle by calling the IVMRMixerControl::SetOutputRect() method.

More details on this you can find here: http://darinhiggins.com/2009/12/31/flipping-video-with-directshow/

ghost commented 5 years ago

Thanks for this information.