當前位置: 首頁>>代碼示例>>Python>>正文


Python Line.strokeColor方法代碼示例

本文整理匯總了Python中reportlab.graphics.shapes.Line.strokeColor方法的典型用法代碼示例。如果您正苦於以下問題:Python Line.strokeColor方法的具體用法?Python Line.strokeColor怎麽用?Python Line.strokeColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在reportlab.graphics.shapes.Line的用法示例。


在下文中一共展示了Line.strokeColor方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: makeInnerLines

# 需要導入模塊: from reportlab.graphics.shapes import Line [as 別名]
# 或者: from reportlab.graphics.shapes.Line import strokeColor [as 別名]
    def makeInnerLines(self):
        # inner grid lines
        group = Group()

        w, h = self.width, self.height

        if self.useLines == 1:
            if self.orientation == 'vertical':
                r = self.makeLinePosList(self.x, isX=1)
                for x in r:
                    line = Line(x, self.y, x, self.y + h)
                    line.strokeColor = self.strokeColor
                    line.strokeWidth = self.strokeWidth
                    group.add(line)
            elif self.orientation == 'horizontal':
                r = self.makeLinePosList(self.y, isX=0)
                for y in r:
                    line = Line(self.x, y, self.x + w, y)
                    line.strokeColor = self.strokeColor
                    line.strokeWidth = self.strokeWidth
                    group.add(line)

        return group
開發者ID:halimath,項目名稱:taskcardmaker,代碼行數:25,代碼來源:grids.py

示例2: _draw_segment

# 需要導入模塊: from reportlab.graphics.shapes import Line [as 別名]
# 或者: from reportlab.graphics.shapes.Line import strokeColor [as 別名]
    def _draw_segment(self, cur_drawing):
        """Draw a half circle representing the end of a linear chromosome.
        """
        # set the coordinates of the segment -- it'll take up the left part
        # of the space we have.
        width = (self.end_x_position - self.start_x_position) \
                * self.chr_percent
        height = self.start_y_position - self.end_y_position

        center_x = self.start_x_position + width / 2
        if self._inverted:
            center_y = self.start_y_position
            start_angle = 180
            end_angle = 360
        else:
            center_y = self.end_y_position
            start_angle = 0
            end_angle = 180
        
        cap_wedge = Wedge(center_x, center_y, width / 2,
                          start_angle, end_angle, height / 2)

        cap_wedge.fillColor = self.fill_color
        cur_drawing.add(cap_wedge)

        # draw a line to cover up the the bottom part of the wedge
        if self._inverted:
            cover_line = Line(self.start_x_position, self.start_y_position,
                              self.start_x_position + width,
                              self.start_y_position)
        else:
            cover_line = Line(self.start_x_position, self.end_y_position,
                              self.start_x_position + width,
                              self.end_y_position)

        if self.fill_color is not None:
            cover_color = self.fill_color
        else:
            cover_color = colors.white

        cover_line.strokeColor = cover_color
        cur_drawing.add(cover_line)
開發者ID:dbmi-pitt,項目名稱:DIKB-Evidence-analytics,代碼行數:44,代碼來源:BasicChromosome.py

示例3: draw

# 需要導入模塊: from reportlab.graphics.shapes import Line [as 別名]
# 或者: from reportlab.graphics.shapes.Line import strokeColor [as 別名]
 def draw(self):
     l = Line(self.x,self.y,self.x+self.width,self.y)
     l.strokeColor = self.strokeColor
     l.strokeDashArray  = self.strokeDashArray
     l.strokeWidth = self.height
     return l
開發者ID:Distrotech,項目名稱:reportlab,代碼行數:8,代碼來源:legends.py

示例4: render

# 需要導入模塊: from reportlab.graphics.shapes import Line [as 別名]
# 或者: from reportlab.graphics.shapes.Line import strokeColor [as 別名]

#.........這裏部分代碼省略.........

        elif node.tag == self.SVG_CIRCLE:
            cx = parseLength(node.get('cx', '0'))
            cy = parseLength(node.get('cy', '0'))
            r = parseLength(node.get('r'))

            if r > 0.:
                shape = Circle(cx, cy, r)
                self.addShape(parent, node, shape)

        elif node.tag == self.SVG_ELLIPSE:
            cx = parseLength(node.get('cx', '0'))
            cy = parseLength(node.get('cy', '0'))
            rx = parseLength(node.get('rx'))
            ry = parseLength(node.get('ry'))

            if rx > 0. and ry > 0.:
                shape = Ellipse(cx, cy, rx, ry)
                self.addShape(parent, node, shape)

        elif node.tag == self.SVG_POLYLINE:
            # convert points
            points = node.get('points').strip()
            if len(points) == 0:
                return

            points = list(map(parseLength, re.split('[ ,]+', points)))

            # Need to use two shapes, because standard RLG polylines
            # do not support filling...
            group = Group()
            shape = Polygon(points)
            self.applyStyleToShape(shape, node)
            shape.strokeColor = None
            group.add(shape)

            shape = PolyLine(points)
            self.applyStyleToShape(shape, node)
            group.add(shape)

            self.addShape(parent, node, group)

        elif node.tag == self.SVG_POLYGON:
            # convert points
            points = node.get('points').strip()
            if len(points) == 0:
                return

            points = list(map(parseLength, re.split('[ ,]+', points)))

            shape = Polygon(points)
            self.addShape(parent, node, shape)

        elif node.tag == self.SVG_IMAGE:
            x = parseLength(node.get('x', '0'))
            y = parseLength(node.get('y', '0'))
            width = parseLength(node.get('width', '0'))
            height = parseLength(node.get('height', '0'))

            # link id
            link_id = node.get(self.LINK)

            filename = os.path.join(os.path.dirname(self.filename), link_id)
            shape = Image(x, y, width, height, filename)

            self.addShape(parent, node, shape)
開發者ID:eseifert,項目名稱:svg2rlg,代碼行數:70,代碼來源:svg2rlg.py


注:本文中的reportlab.graphics.shapes.Line.strokeColor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。