HELP!!
I am working with a LEADTOOL Raster COM imaging component which is basically an enhanced picturebox that I am using to implement various transition effects when swapping one image to another. I am trying to implement threading so I can have multiple transitions occur simultaneously. The COM component is supposed to be thread-safe.
There is a property on the control EnableProgressEvents that if set to true will call a method ie Progress() 100 times, similar to a callback I guess, throughout progress of the transition effect. This is intended to be used as a means of cancelling the process, I am trying to use the method as an opportunity to pause the thread so that the other threads can catch up, creating the appearance that all transitions are occurring at once.
The transition effect is triggered by the use of the components Load method. So I wrote some c# code that will spawn two threads from the main thread, each thread will call Object.Load(). In Object.Progress() I tried Thread.Sleep(100) & Thread.Suspend() in an attempt to interrupt the thread 1 and hand over execuion to the thread 2. Upon running the code, the transition did occur but sequentially, not simultaneously. Using some verbose output to see what was happening, I could see the new threads, each calling Object.Load(), however the activity in the Object.Progress() was actioned by the main thread not the spawned threads.
Is there something that I am missing here? Any ideas would be much appreciated.
I am working with a LEADTOOL Raster COM imaging component which is basically an enhanced picturebox that I am using to implement various transition effects when swapping one image to another. I am trying to implement threading so I can have multiple transitions occur simultaneously. The COM component is supposed to be thread-safe.
There is a property on the control EnableProgressEvents that if set to true will call a method ie Progress() 100 times, similar to a callback I guess, throughout progress of the transition effect. This is intended to be used as a means of cancelling the process, I am trying to use the method as an opportunity to pause the thread so that the other threads can catch up, creating the appearance that all transitions are occurring at once.
The transition effect is triggered by the use of the components Load method. So I wrote some c# code that will spawn two threads from the main thread, each thread will call Object.Load(). In Object.Progress() I tried Thread.Sleep(100) & Thread.Suspend() in an attempt to interrupt the thread 1 and hand over execuion to the thread 2. Upon running the code, the transition did occur but sequentially, not simultaneously. Using some verbose output to see what was happening, I could see the new threads, each calling Object.Load(), however the activity in the Object.Progress() was actioned by the main thread not the spawned threads.
Is there something that I am missing here? Any ideas would be much appreciated.