PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

Easy way to convert .Net GraphicsPath to XGraphicsPath?
http://forum.pdfsharp.de/viewtopic.php?f=2&t=4640
Page 1 of 1

Author:  AlainM [ Fri Aug 09, 2024 6:27 pm ]
Post subject:  Easy way to convert .Net GraphicsPath to XGraphicsPath?

Hi all,

I'm new to PDFSharp and am just starting to integrate it within our CAD application.

Most of the drawing objects we handle use GraphicsPath class from .Net to be rendered on Screen. So I was wondering if there might be a known method embedded within the PDFSharp tools to convert a GraphicsPath object to a XGraphicsPath? (Which would save me a tone of coding...)

Or alternatively, has anyone here shared such a method they coded themselves?

Thanks in advance!

Author:  Thomas Hoevel [ Mon Aug 12, 2024 7:54 am ]
Post subject:  Re: Easy way to convert .Net GraphicsPath to XGraphicsPath?

Hi!

There is a c'tor that takes a PathGeometry object.
Code:
public XGraphicsPath(PathGeometry geometry)


There isn't a c'tor that takes a GraphicsPath yet.
I'll discuss this with Stefan.
If you come up with useful code for that purpose, maybe we can build up on your code.

Author:  AlainM [ Mon Aug 12, 2024 2:12 pm ]
Post subject:  Re: Easy way to convert .Net GraphicsPath to XGraphicsPath?

Thanks for the reply.

By "c'tor", do you mean a constructor? If so, I couldn't get this to work. (XGraphicsPath only seem to have one constructor with no parameter...)

But maybe I'm doing somethng wrong....

Thomas Hoevel wrote:
If you come up with useful code for that purpose, maybe we can build up on your code.


Not having a better solution, I've decided to choose a different route, and rather create XGraphicsPath for all my object types (line segment, circles, rectangles, etc...)

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/