Click here to Skip to main content
15,798,592 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using DirectShow library in C# to capture video from webcam,but i want to place a changing text over the picturebox which displays the video,the problem is while displaying the video,the label appears with its background,i tried to change the label's background to transparent and setting the label's parent to the picturebox,but it makes the label invisible,i looked at directshow samples(dxtext,VMR9,bitmapmixer),but none of them worked with me,i want a method to display a text over the picturebox like this

https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTkjwn7PDZC7ZI5nyHL31G1a71p-3nZPG0H2VRHOrv0ozfp8ty7Vg

the only difference is that i want it above a preview video,so any help making the label transparent or using a any draw method the paint ?.THANKS!
Posted

I would not recommend to dig into it. The problem is only actual for System.Windows.Forms, or any other (3rd-party) library based on GDI/GDI+, which does not live well with DirectX and hence DirectShow.

If you switch to WPF, all such problems will immediately disappear. WPF is itself fully based on DirectX. With WPF, you can freely overlay anything on anything, including video, and do many other things impossible or very difficult with GDI. No legacy controls and Windows messaging is not used internally.

—SA
 
Share this answer
 
Thanks Sergey Alexandrovich Kryukov but i have to use WFA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900