TBitmap from a thread
Posted on 2004-04-01
I have a component that is a descendant of a TImage. I use this to play back a custom video format I created.
I have created a thread for my playback loop (both to wait for data over the network before continuing, and for timing). This loop pauses as long as it needs to and then enters a critical section to call a procedure that processes the data and draws it to the canvas.
If I create that loop in the main thread, I don't run into any problems. However when I move that loop the a thread, it will work for a few seconds and then stop drawing. Everythign acts as though it is still working except the data is never displayed.
The loop will be the only thing that calls anything that draws. I tried TCanvas.Lock/Unlock however it just freezes.
Any tips on what to look for?