How to turn GraphicsPath
into SvgPath
or some sort of drawable on canvas?
#908
Unanswered
ryuujo1573
asked this question in
Q&A
Replies: 2 comments 4 replies
-
public void SvgTest()
{
var path = new GraphicsPath();
path.AddBezier(
0f, 0f,
0f, 4.8f,
0f, 4.8f,
4.8f, 4.8f
);
var svgPath = new SvgPath();
var segment = new SvgMoveToSegment(new PointF(0, 0));
segment.AddToPath(path);
svgPath.PathData = new SvgPathSegmentList();
svgPath.PathData.Add(segment);
var hBitmap = new Bitmap(1000, 1000).GetHbitmap(Color.WhiteSmoke);
var img = Image.FromHbitmap(hBitmap);
svgPath.RenderElement(SvgRenderer.FromImage(img));
img.Save("test.bmp");
} Why this doesn't work and outputs an empty bmp/png? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't think it's appropriate to generate from For example, why not try using |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was dizzy about implementing my jigsaw puzzle generator.
I'll draw some curves as jigsaw sides in Ai and export as
.svg
, and I have no idea of harvesting my curves in drawing jigsaw puzzles automatically.Thank you for your work, and uhhh, if it is convenient for you, any reply would help!
Beta Was this translation helpful? Give feedback.
All reactions