Skip to content

DrawPath and FillPath throw exception #98

@MarkhusGenferei

Description

@MarkhusGenferei

Hi, This library is really great !

I am exploring geometries. In a form subclassing D2DForm, the code sample below throws a System.AccessViolationException : 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

What am I doing wrong ?
Thank you

protected override void OnRender(D2DGraphics g)
{
  g.Clear(D2DColor.FromGDIColor(this.BackColor));
  
  using (var rect = this.Device.CreateRectangleGeometry(new D2DRect(10, 10, 20, 20)))
  {
     g.DrawPath(rect, D2DColor.BlueViolet, 1, D2DDashStyle.Dash);
  }
  
  using (var circle = this.Device.CreateEllipseGeometry(new D2DPoint(100, 100), new D2DSize(50, 50)))
  {
     using (var pen = this.Device.CreatePen(D2DColor.BlueViolet, D2DDashStyle.Dash))
     {
	  if (pen != null)
	  {
		  g.DrawPath(circle, pen, 2);
		  g.FillPath(circle, D2DColor.DarkBlue);
	  }
     }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions