2016-09-05 173 views
1

請告訴我,如果在Kivy帆布快速繪製,我得到非常尖銳, 多段線圖,但如果繪製非常慢,然後我得到流暢的線條。Kivy帆布 - 快速繪製 - 多段線

... 

    def on_touch_down(self, touch): 
     if Widget.on_touch_down(self, touch): 
      return True 
     print(touch.x, touch.y) 
     with self.canvas.before: 
      Color(*get_color_from_hex('#0080FF80')) 
      Line(circle=(touch.x, touch.y, 2), width=2) 
      touch.ud['current_line'] = Line(points=(touch.x, touch.y), width=2) 

    def on_touch_move(self, touch):        
     if 'current_line' in touch.ud: 
      touch.ud['current_line'].points += (touch.x, touch.y) 
    ... 

這是我的例子:

this is my example!

誰知道我怎麼能修復它? 我可以在Kivy中快速平滑嗎?

回答

0

我不知道爲什麼當你在kivy中快速繪製時線條看起來不光滑,你能否請你在不同的設備上測試它。

+0

當然我測試了許多不同的設備,也許我是有點誇張,但實物圖是不是越多越好 - [另一PIC鏈接](HTTP://我。 stack.imgur.com/n3jqw.png) –

0

其實我測試了你的代碼,不能產生你遇到的問題。我的意思是,如果我在基維得分快或慢,那並不重要。其中一半是我快速緩慢但輸出沒有差異。我建議你試試https://kivy.org/docs/tutorials/firstwidget.html。如果此示例的繪圖輸出在繪製速度很快時很劇烈,那麼您的環境可能有問題,因爲它適用於我的環境。如果在快速繪圖中平滑,那麼你的項目必須有問題。

+0

在PC上一切都很好,但我們試着在Android平臺上進行測試。 您可以在我的應用程序中查看它 - [SpringPaint](https://play.google.com/store/apps/details?id=ek.myspaint) –