Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open path #52

Open
mystery123sk opened this issue Feb 18, 2021 · 2 comments
Open

Open path #52

mystery123sk opened this issue Feb 18, 2021 · 2 comments

Comments

@mystery123sk
Copy link

mystery123sk commented Feb 18, 2021

The library is fantastic, thank you for that. I have a little problem with the ClosePath - I can't specify, whether the path should be opened or closed (as it is possible using D2D1_FIGURE_END in D2D). It's impossible to draw bezier cubic curves like this (the first point is always connected to end point).

Also there is a crash/hang, when I don't call ClosePath and I'm trying to draw geometry. E.g.:

var path = crc.GR.Device.CreatePathGeometry();
path.SetStartPoint(new D2DPoint(0, 0.5f));

D2DBezierSegment seg1 = new D2DBezierSegment()
{
  point1 = new D2DPoint(0.25f, 0),
  point2 = new D2DPoint(0.75f, 1),
  point3 = new D2DPoint(1, 0.5f),
};
path.AddBeziers(new D2DBezierSegment[] { seg1 });
path.ClosePath(); //if I don't add this line, the application hangs

graphics.DrawPath(path, D2DColor.AliceBlue, 2 * pixelSize);
@jingwood
Copy link
Owner

Thanks! @mystery123sk, hope it helps you.

Can you please provide an image that shows your desired result? I'd like to test with your requirement.

@mystery123sk
Copy link
Author

image

The problem is, I want to draw non-closed polygon/bezier line. It's not possible using your library functions. The library draws always last point connected to first one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants