|
Now open a thread under a common class, as follows:
void CTest :: testFunc ()
{
while (flag == TRUE)
{
if (there are images in the buffer)
Display the image;
Sleep (100);
}
}
problem:
1. In this way, it is possible to display an image every 100ms (of course, there must be an image in the buffer at this time). I wonder if this can achieve a timing display function? Is this different from using a timer? Will it receive interference from other threads?
2. If there is no image in the buffer when it is ready to be displayed, it will definitely not be displayed at this time. You must wait another 100ms before coming over to check the display. But it is very likely that there is an image in the buffer 10ms after the condition is judged, so that the image display is not real-time. I wonder if there is any solution to this?
Thank you all! !! !! |
|