Use the DrawLine method over a video panel

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.
ssiegwaldAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

deadlyDevCommented:
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?
0
mac-willCommented:
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()
         {
             InitializeComponent();
         }
  
        protected override CreateParams CreateParams
         {
             get
             {
                 CreateParams cp = base.CreateParams;
                 cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT
                 return cp;
             }
         }
 
         protected void InvalidateEx()
         {
  
            if (Parent == null)
                 return;
 
            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

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.