MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / draw_line

Method draw_line

src/__init__.py:11084–11116  ·  view source on GitHub ↗

Draw a line from point p1 to point p2.

(
            page: 'Page',
            p1: point_like,
            p2: point_like,
            color: OptSeq = (0,),
            dashes: OptStr = None,
            width: float = 1,
            lineCap: int = 0,
            lineJoin: int = 0,
            overlay: bool = True,
            morph: OptSeq = None,
            stroke_opacity: float = 1,
            fill_opacity: float = 1,
            oc=0,
            )

Source from the content-addressed store, hash-verified

11082 return Q
11083
11084 def draw_line(
11085 page: 'Page',
11086 p1: point_like,
11087 p2: point_like,
11088 color: OptSeq = (0,),
11089 dashes: OptStr = None,
11090 width: float = 1,
11091 lineCap: int = 0,
11092 lineJoin: int = 0,
11093 overlay: bool = True,
11094 morph: OptSeq = None,
11095 stroke_opacity: float = 1,
11096 fill_opacity: float = 1,
11097 oc=0,
11098 ) -> Point:
11099 """Draw a line from point p1 to point p2."""
11100 img = page.new_shape()
11101 p = img.draw_line(Point(p1), Point(p2))
11102 img.finish(
11103 color=color,
11104 dashes=dashes,
11105 width=width,
11106 closePath=False,
11107 lineCap=lineCap,
11108 lineJoin=lineJoin,
11109 morph=morph,
11110 stroke_opacity=stroke_opacity,
11111 fill_opacity=fill_opacity,
11112 oc=oc,
11113 )
11114 img.commit(overlay)
11115
11116 return p
11117
11118 def draw_oval(
11119 page: 'Page',

Callers 3

test_drawings2Function · 0.45
test_drawings3Function · 0.45

Calls 4

PointClass · 0.85
new_shapeMethod · 0.80
finishMethod · 0.45
commitMethod · 0.45

Tested by 2

test_drawings2Function · 0.36
test_drawings3Function · 0.36