Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF C# threading

$
0
0

I am using Kinect for my project. I have to process frames from the RGB camera and depth sensor and the skeleton positions. 

With 30fps input at 640 x 480 resolution, I am unable to write all the frames to the file. So I what I decided to do is use threading for my function that saves the RGB, depth frames and writes skeleton position to the file. But this is not working as intended. 

 I start the thread as follows.

Thread myThread = new Thread(new ThreadStart(showTime)); 

myThread.Start();

In my showTime() function I use this.Dispatcher.Invoke((Action)(() =>
 {

//code for writing frames to the file. 

}

This works well as i am able to save all the frames well. The problem lies when I am trying to write the skeleton joint position to a text file it gives the following error: (The file is being used by another process)

I tried debugging but it seems not to work. What could be an alternative for this. 

Thank you


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>