2
我正在用Streamgeometry來新繪製一個簡單的箭頭。現在我需要將箭頭轉到指定的角度。但如何旋轉這個幾何?旋轉幾何路徑
Dim pt1 As New Point(X1, Me.Y1) 'left point
Dim pt2 As New Point(_X2, Me.Y2) 'right point
Dim pt3 As New Point(_X2 + (HeadWidth * cost - HeadHeight * sint), Y2 + (HeadWidth * sint + HeadHeight * cost)) 'arrow line down
Dim pt4 As New Point(_X2 + (HeadWidth * cost + HeadHeight * sint), Y2 - (HeadHeight * cost - HeadWidth * sint)) 'arrow line up
context.BeginFigure(pt1, True, False)
context.LineTo(pt2, True, True)
context.LineTo(pt3, True, True)
context.LineTo(pt2, True, True)
context.LineTo(pt4, True, True)
感謝您的回答。我嘗試過,但如果我像你所建議的那樣使用Rotatetransform來創建幾何體,那麼它就不會起作用。我不知道爲什麼。 – Nasenbaer 2011-06-17 12:44:33