作图已经用了thread了,问题在于:帧是固定的,频率相对而言还是高,因为这一帧过来的时候,必须显示与这一帧所对应的已经画好的图,是这个画图的过程需要的时间太长 我是这样做的: void Player_OnNewFrame(sender as Object, e as FrameBitmapEventArgs) { // draw something //问题是这里执行的时间太长 repaint() }
dim threadRepaint dim needRepaint = false
void repaint() { if threadRepaint is nothing { //new threadRepaint and start-----(addressof draw()) } if not threadRepaint is Nothing and threadRepaint is alive { needRepaint = true; } }
void draw() { do { needRepaint = false; //do something loop until Not needRepaint } }