Transparent canvas on top of MoviePlayer

I want to draw a PNG image on top of MoviePlayer on Windows. I have already achieved what I want to do. One remaining issue, the canvas still show window back color (in the picture below, the dark color is window back color). Any idea how to fix this issue?

Would you mind sharing how you managed to make the Canvas stay on top of the MoviePlayer and not flicker? I don’t have an answer for making the Canvas transparent beyond “is the Transparent switch on in the IDE?” but I am very interested in the answer to how you got Windows to behave.

Pretty sure this is going to be a recipe for disaster. Layering controls, any controls in Windows, is going to flicker madly and will result in a poorly behaving application. I can’t imagine the Windows Media Player being any different.

Its an easy WS_CLIPSIBLINGS call on the controls in the form, I put a demo up a few months ago, I cant find the post at the moment though. You can also do it using my ZOrderFix code from a while back.

As Asis has found outs its a little hard to draw over the top with a transparency, mainly due to the way windows media player works. Probably the easiest method is to have two windows, the first (rear) window showing the movie and the second (front) containing the overlay. Make the front window semi-transparent with WS_EX_LAYERED then tweak the look of it. If you set WS_EX_TRANSPARENT on the front window, all clicks will pass through it to the window behind essentially making it look just like a water mark on the video.Then just make the front window move position with the rear window and job done.

I got side tracked by Designated Survivor on Netflix so its a bit late but here you go:

https://www.dropbox.com/s/p8fec3luw7i1b8b/TestMovieWithOverlay.zip?dl=1

Just point it at a video of your choice when you start it up.

I threw it together, taking snippets of code from some of my test projects so its not pretty.

The only caveat is that it needs a crisp edged image when using the chroma keying (SetLayeredWindowAttributes).

There’s probably other/better ways of injecting an image into the video stream or whatever but its late :wink:

I also put the “canvas in front of the movie player” demo in there which is much easier to use/do, if you have a flat edged solid logo, you could use that method.

Enjoy

Tested on Windows 7 (VM) and Windows 10, don’t see any flicker yet. on Windows 7 (VM), Xojo flickers as hell. So, I think I’ve minimized the flicker.

You could use our OverlayMBS class in the MBS Plugins to make an overlay window.

[quote=353218:@JulianS]I got side tracked by Designated Survivor on Netflix so its a bit late but here you go:

https://www.dropbox.com/s/p8fec3luw7i1b8b/TestMovieWithOverlay.zip?dl=1

Just point it at a video of your choice when you start it up.

I threw it together, taking snippets of code from some of my test projects so its not pretty.

The only caveat is that it needs a crisp edged image when using the chroma keying (SetLayeredWindowAttributes).

There’s probably other/better ways of injecting an image into the video stream or whatever but its late :wink:

I also put the “canvas in front of the movie player” demo in there which is much easier to use/do, if you have a flat edged solid logo, you could use that method.

Enjoy[/quote]
I’ll investigate this later. Currently, I use background color.

Sorry this is an old thread but its right in line with what I am attempting to do. I see this has no linux support, I want to do this on a Pi.

I am creating a simple content management system, but I may want to overlay ads or other information on top of a playing video and This plugin doesnt do Raspberry Pi?

I saw the VLC plugins as well, not sure if it would help me either as they do make a compiled HW accelerated version of VLC for the Pi.

[quote=372061:@Marc Bates]Sorry this is an old thread but its right in line with what I am attempting to do. I see this has no linux support, I want to do this on a Pi.

I am creating a simple content management system, but I may want to overlay ads or other information on top of a playing video and This plugin doesnt do Raspberry Pi?

I saw the VLC plugins as well, not sure if it would help me either as they do make a compiled HW accelerated version of VLC for the Pi.[/quote]
You might have better lucking using a HTMLViewer and creating an HTML page with what you want on it. I had a client that just recently did this on a Pi. He had to display a video, along with variable text, and respond to a 2.8" touchscreen too. The HTMLViewer let him accomplish all of that.