Problem with thread

Aug 16, 2012 at 8:56 PM
Edited Aug 16, 2012 at 8:56 PM

Hello all.

I've made a simple application using WPF Media Kit, which allow me to capture image from my webcam. I created thread to render media control and used Dispatcher.Invoke method, but still have exception that thread can't access control.

Here is my code:


 WebCam.Dispatcher.Invoke(DispatcherPriority.Render, (ThreadStart)(delegate(){
                      bmp.Render(WebCam); }));}
 bmp is RenderTargetBitmap.

 

Thank you for all help.