2011-06-14 30 views

回答

0

注意事項:必須在UI線程上繪製圖表,那麼您希望圖表(實時還是延遲)的響應速度如何?

佈局圖(我在紙上做這個)來確定X和Y範圍,限制等。這將幫助您清楚地瞭解您想要的內容。

把它放在一起沒有辦法測試,但這可能會讓你朝着正確的方向前進。我從來沒有創造過任何非常像「火花線」的東西。

Point newPoint; 
Point lastPoint; 

void SetNewPoint(Point NewPoint); 
{ 
    newPoint = NewPoint; 
    myPicBox.Refresh (); // include the Rectangle area to refresh 
} 

void myPicBox_Paint (object sender, PaintEventArgs e) 
{ 
    // grab Graphics handle 
    // paint line from lastPoint to newPoint 

    // you will have to keep a collection of points if redrawing the entire graph 
}