0
我想以循環(或類似)的增量繪製一個圖像作爲進度條,我原本想用畫布中的線條畫出這個圖像,但最終我對它的外觀感到不滿。畫布以循環增量繪製圖像?
這jsfiddle顯示了我希望它看起來如何100%,沒有任何酒吧將被繪製在0%,酒吧的開始和結束點也被標記。
我想這可能使用額外的drawImage參數來實現,我已經使用這個使用圖像作爲填充繪製一個倒數計時器,但我不知道如何在一個圓形畫忽視中間區域增加複雜性的方式?
context.drawImage(img,sx,sy,swidth,sheight,x,y,width,height);
這可能是解決問題的錯誤方法,這可能嗎?
感謝再次,可以在單個線卡止件的圖像或它必須是一個封閉的形狀?你昨天給我畫的一個剪切線(?),而不是一條彩色線的例子,這個例子對於這個任務來說是完美的。 – mao 2013-05-03 21:58:23
不行,行不能剪裁路徑。如果你想用我以前的例子進行裁剪,只需將直線替換爲弧線,將弧線替換爲楔子即可。 – markE 2013-05-03 22:36:19
謝謝,現在就去。我不認爲你可以告訴我我在做什麼錯誤的這些矩形?我把它分成兩個函數一個用於垂直,另一個用於水平,並且保持y座標相同,第一個和第二個函數相同。 http://jsfiddle.net/P2qTq/1/ – mao 2013-05-03 23:23:53