Jump to content

sapphiron

Newbies
  • Posts

    7
  • Joined

  • Last visited

Posts posted by sapphiron

  1. Rick, I really appreciate you answering my posts. I decided to ask for help in this forum, since if I'm a paint.net user and I know if someone helps me in this is helping this project too.

    Anyway, as many developers, I'm working for a client that wont be very happy to know that I need 2 works for this and of course I wont ask anyone to do this for me.

    So, I will try to work this out as fast as I can, and if I came up with something I'll let you know.

  2. I've seen the way you are getting a path from the region, and indeed is a 'brute force' way to do it.

    I just cant use this way since I need to handle floating point operations, but I can give you some hints on how to get this in a more elegant way. (Im working on this right now).

    First, java.awt.geom.Area has an inmplementation of how to do logical operation to paths (It's using PathIterator to build segments and then operate them with algebraic functions). This can be implemented to .NET since it's not a very complicated algorithm.

    RegionData contains information about the paths that forms a region, the problem it's not documented. I was working on this solution until now, since when a operation is applied to the region, the format seems to change.

    What I have so far:

    Region.GetRegionData().Data returns an array of bytes that represents that shape, this is what I have so far. (Before doing an operation to a region).

    bitarray[28] has the number of paths of this region, I dont remember if I was converting it using int32, int16 o just ToString().

    bitarray[36]:

    First point of the path.

    From now on, it's dificult to continue, since if the point is an Int it can be transformed using ToInt16 (so 2 bytes are taken) but if it's a float point 4 bytes are needed (using ToSingle).

    bitarray[length - pathCount] first pathPointType.

    These are easy to get, since they just need one byte per pathPointType.

    Well, that's all I have, I hope to have something more this week. If someone knows something about regionData please share it.

  3. BoltBait, thanks four your answer.

    Im not trying to do a plugin, I just looking to get a GraphicsPath object from a region (System.Drawing.Region). Purely Gdi+.

    Basically I need:

    Build a path ( I need point and dataTypes).

    Build a region from that path.

    Apply some boolean operation with other region.

    Get the path of the resulting operation. ( with the pointsF[] and dataType[])

    Of course, this could be solved if boolean operation were applicable on GraphicsPath objects.

×
×
  • Create New...