mindsensorsUI.py 文件源码

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

项目:PiStorms 作者: mindsensors 项目源码 文件源码
def fillCircle(self, x, y, radius, fill = (255,255,255), display = True):
        draw = self.disp.draw()
        actx = self.screenXFromImageCoords(x,y)
        acty = self.screenYFromImageCoords(x,y)
        draw.ellipse((actx-radius,acty-radius,actx+radius,acty+radius), fill = fill)
        if(display):
            self.disp.display()

    ## Draw a circle on the screen (rotated to screen)
    #  @param self The object pointer.
    #  @param x The center x coordinate of the circle.
    #  @param y The center y coordinate of the circle.
    #  @param radius The radius of the circle.
    #  @param fill The color of the inside of the circle. Optional, defaults to None
    #  @param outline The color of the outer edge of the circle. Optional, defaults to Black
    #  @param display Choose to immediately push the drawing to the screen. Optional, defaults to True.
    #  @remark
    #  To use this function in your program:
    #  @code
    #  ...
    #  red circle with blue outline:
    #  screen.drawCircle(100, 100, 15, fill = (255,0,0), outline=(0,0,255))
    #  @endcode
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号