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
评论列表
文章目录