Use the DrawLine method over a video panel

Posted on 2009-05-28
Medium Priority
Last Modified: 2013-12-17
I'm trying to create an application where the user can use "crayons" to draw lines and such over a video playback.  It sounds simple, but all my attempts have not worked.  I had a version where I was displaying bitmaps at the video rate, but it flickered so much it was not usable.  But, the crayons worked.  Now that I have solved the flickering by using the Movie method of the DriectX, my crayons no longer show up.
I'm using C# and would love a code snippit to demonstrate the proper way to do this.
Question by:ssiegwald

Expert Comment

ID: 24490722
To achieve this you will most likely have to use the win32 video api's. It has been about 9 years since I last used those API's so I wont be able to tell you which ones :P Once you get a handle to the movie, you will then be able to call a win32 api function to get a handle to the buffers, which you can then draw onto using another win32 function... really not a lot of fun (I know from experience...) but at the time was the only way I could process video with some sort of performance reliability...

Just as an after thought, what happens when you place another control (such as a panel) over the video playback? Perhaps using another control as an overlay may work?

Accepted Solution

mac-will earned 1000 total points
ID: 24494216
Ya I would make a transparent component and put it over the video.
Handle the drawing onto the panel.

Here is a start:
public partial class TransparentPanel: Panel
         public TransparentPanel()
        protected override CreateParams CreateParams
                 CreateParams cp = base.CreateParams;
                 cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT
                 return cp;
         protected void InvalidateEx()
            if (Parent == null)
            Rectangle rc = new Rectangle(this.Location, this.Size);
            Parent.Invalidate(rc, true);
        protected override void OnPaintBackground(PaintEventArgs pevent)
             //do not allow the background to be painted 

Open in new window


Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Native ability to set a user account password via AD GPO was removed because the passwords can be easily decrypted by any authenticated user in the domain. Microsoft recommends LAPS as a replacement and I have written an article that does something …
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…
In the video, one can understand the process of resizing images in single or bulk. Kernel Bulk Image Resizer is an easy to use tool for resizing large number of images. One can add and resize multiple images with this tool in single go. The video sh…

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question