We need to draw an VObjectPath with "Transparent hole" at the middle with a given PointF[].
The simple idea will be something like XOR of 2 VObjectPath. Wondering how can we do XOR on VObject ? Or if create own Custom VObjectPath is needed, please advise us on how..
You can do this by modifying existing PathVObject or creating new one - it depends on what you want to get.
If you need to "make a hole" in RectangleVObject - you can inherit it and add new circular shape to it's path. By default paths are filled with FillMode.Alternate, so this will result in a "hole effect".
If you need to "make a hole" in an Image - you can just create ImageVObject based on image with transparent area inside. Or make this area with Graphics Mill methods.
If you need to "make a hole" in RectangleVObject - you can inherit it and add new circular shape to it's path. By default paths are filled with FillMode.Alternate, so this will result in a "hole effect".
Best regards, Alex Kon
Do you mind to give us an example on this? Thanks.
If you need to "make a hole" in RectangleVObject - you can inherit it and add new circular shape to it's path. By default paths are filled with FillMode.Alternate, so this will result in a "hole effect".
Best regards, Alex Kon
Do you mind to give us an example on this? Thanks.
What we really need is a RectangleVObject with a Transparent Polygon inside. Big Thanks...
I'm found this article, but how to implement this function to two polyline objects ?
For example I'm create fist big polyline. I'm create second polyline into first polyline. After button click I need create hole into first big polyline.
Unfortunately, we do not have code snippets illustrating this. You can implement it like in the code for rectangle listed above, i.e. inherit your class from PolylineVObject, and implement a new method which will allow to make a hole in the first rectangle. In your case, first large polyline will be objects instead of rectangle, and second polilyne - instead of circle.
for example i'm create simple custom polyline class:
Public Class CustomPolylineObject Inherits Aurigma.GraphicsMill.WinControls.PolylineVObject Public Sub New(ByVal p() As PointF) MyBase.New(p, True, Drawing2D.FillMode.Alternate) MyBase.Path.AddRectangle(New RectangleF(30, 30, 100, 100)) End Sub End Class
And call in form:
Dim pf As PointF() = {New System.Drawing.PointF(20.0F, 20.0F), _ New System.Drawing.PointF(20.0F, 220), _ New System.Drawing.PointF(220, 220), _ New System.Drawing.PointF(220, 20.0F)} Dim o As New CustomPolylineObject(pf) MultiLayerViewer1.CurrentLayer.VObjects.Add(o)
Create polyline with hole (This OK), but after drag to new position hole in polyline is filled with polyline background.(missing) If create custom rectangleVobject (see above) its all OK. Thank you,
This behavior occurs because polyline is one-dimensional object. The area inside of polyline, filled by a color, is conditional. The polygon created with polyline object does not have an exact square bounded by borders. In other words, it is not possible to create a one-dimensional object with placing a two-dimensional one on it. You can create a rectangle hole on rectangle (or ellipse) objects only, it is working okay.