labelme修改

頂點粗細:self.P_ROUND: 圓形

    def drawVertex(self, path, i):
        d = self.point_size / self.scale
        shape = self.point_type
        point = self.points[i]
        if i == self._highlightIndex:
            size, shape = self._highlightSettings[self._highlightMode]
            d *= size
        if self._highlightIndex is not None:
            self._vertex_fill_color = self.hvertex_fill_color
        else:
            self._vertex_fill_color = self.vertex_fill_color
        if shape == self.P_SQUARE:
            path.addRect(point.x() - d / 2, point.y() - d / 2, d, d)
        elif shape == self.P_ROUND:
            path.addEllipse(point, d / 3.0, d / 3.0)

線的粗細:0是很細,1中等

  )
            pen = QtGui.QPen(color)
            # Try using integer sizes for smoother drawing(?)
            pen_width=max(1, int(round(1.0 / self.scale)))
            pen.setWidth(0)
            painter.setPen(pen)

            line_path = QtGui.QPainterPath()

 

#選中高亮蒙版
 if self.fill:
     color = self.select_fill_color if self.selected else self.fill_color
     painter.fillPath(line_path, color)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章