NotImplementedException 来自 .NET 的 CustomLineCap 构造函数

ser*_*hio 5 .net system.drawing gdi+ notimplementedexception

我想绘制一个自定义线帽 - 一个半径为 r 的等边三角形。显然我不能:

  Dim triangleSide As Single = CSng(3 * r / Math.Sqrt(3))
  Dim triangleHeight As Single = CSng(3 * r / 2)
  path = New GraphicsPath()
  Dim points() As PointF = New PointF() { _ 
      New PointF(-triangleSide / 2, 0), _ 
      New PointF(triangleSide / 2, 0), _
      New PointF(0, triangleHeight) }
  path.AddLines(points)

  ' Not Implemented Exception, Was is Das? '
  _HlpCap = New CustomLineCap(path, Nothing) 
Run Code Online (Sandbox Code Playgroud)

我有什么问题还是只是一个框架错误?

编辑:

Mark Cidade 评论后,我尝试使用(Nothing, path)它并有所帮助,但我需要填充三角形,而不是仅将其描边......

Mar*_*ade 0

异常来自 GDI+ 库NotImplemented从其GdipCreateCustomLineCap()函数返回状态。尝试传递笔画路径而不是Nothing

  Dim path2 As GraphicsPath = New GraphicsPath()
  path2.AddLines(points);
  _HlpCap = New CustomLineCap(path, path2) 
Run Code Online (Sandbox Code Playgroud)