mindsensorsUI.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:PiStorms 作者: mindsensors 项目源码 文件源码
def drawLine(self, x1, y1, x2, y2, width = 0, fill = (255,255,255), display = True):
        draw = self.disp.draw()
        actx1 = self.screenXFromImageCoords(x1,y1)
        acty1 = self.screenYFromImageCoords(x1,y1)
        actx2 = self.screenXFromImageCoords(x2,y2)
        acty2 = self.screenYFromImageCoords(x2,y2)
        draw.line((actx1,acty1,actx2,acty2), fill = fill, width = width)
        if(display):
            self.disp.display()

    ## Draw a polyline on the screen (rotated to screen)
    #  @param self The object pointer.
    #  @param endpoints [x1, y1, x2, y2...] The x and y coordinates of each endpoint of the polyline.
    #  @param width The width of the polyline. Optional, defaults to 0.
    #  @param fill The color of polyline. Optional, defaults to white.
    #  @param display Choose to immediately push the drawing to the screen. Optional, defaults to True.
    #  @remark
    #  To use this function in your program:
    #  @code
    #  ...
    #  screen.drawLine([50, 50, 100, 50, 100, 100], width = 0, fill = (255,0,0))
    #  @endcode
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号