mindsensorsUI.py 文件源码

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

项目:PiStorms 作者: mindsensors 项目源码 文件源码
def drawCircle(self, x, y, radius, fill = None, outline = (0,0,0), 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, outline=outline)
        if(display):
            self.disp.display()

    ## Draw a bitmap image on the screen (.png files rcommended)
    #  @param self The object pointer.
    #  @param x The upper left x coordinate of the image.
    #  @param y The upper left y coordinate of the image.
    #  @param width The width of the image.
    #  @param height The width of the image.
    #  @param path The image file path. Optional, defaults to the popup background image.
    #  @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.screen.fillBmp(30, 0, 240, 240, path = os.path.join(currentdir, "dog.png"))
    #  @endcode
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号