2

我想在我的弧线周围画一条线,但是..我做不到。它不适合。这是我在开罗的第一天,所以我不太了解。我该怎么做?

我在 linux 中的 pyGTK+3 的绘图区绘制它。

//我也想为另一端填充和close_path,但我已将其注释掉,以便更容易发现问题。

pos = pos
w = 10
rad = 70 - w/2
b_c = (34/255, 139/255, 34/255)
ctx.set_line_width(w)
ctx.set_source_rgb(b_c[0], b_c[1], b_c[2])

ctx.arc_negative(pos[0], pos[1], rad, 0, -pi/2)
ctx.arc_negative(pos[0], pos[1], rad, pi, pi/2)

#ctx.close_path()
ctx.stroke()
#ctx.stroke_preserve()
#ctx.fill()

ctx.set_line_width(3)
ctx.set_source_rgb(0, 0, 0)

ctx.arc_negative(pos[0], pos[1], rad +w/2 - 3/2, 0, -pi/2)
ctx.arc_negative(pos[0], pos[1], rad +w/2 - 3/2, pi, pi/2)
ctx.close_path()

ctx.stroke()

ctx.arc_negative(pos[0], pos[1], rad, 0, -pi/2)
ctx.arc_negative(pos[0], pos[1], rad, pi, pi/2)

ctx.close_path()

ctx.stroke()
draw_spikes(ctx, pos, rad + w/2)

在此处输入图像描述

4

0 回答 0