Add Gradient Color
Posted: 15 Jan 2009, 18:36
Hi Sergey,
Can you please clarify how to add gradient color to the shape built with polyline? Help file is not very explanative.
The first question is adding Boundaries. Does it mean that I have to always use 2DBoundaryList to add them?
Can I add any entity as a border? And where I can find BoundaryType values?
I tryed the following code based on your examples for adding hatch (pline - existing 3D polyline)
But the code throws an exception that the specified cast is not valid (v2DPolyline has 98 vertexes). Debug shows that the exception is raised when we add 2DPolyline to BoundaryList. Can you clarify me what is wrong?
Thanks a lot.
Elena
Can you please clarify how to add gradient color to the shape built with polyline? Help file is not very explanative.
The first question is adding Boundaries. Does it mean that I have to always use 2DBoundaryList to add them?
Can I add any entity as a border? And where I can find BoundaryType values?
I tryed the following code based on your examples for adding hatch (pline - existing 3D polyline)
Code: Select all
CADGradientPolygon entGrHatch = new CADGradientPolygon ();
CAD2DBoundaryList v2DBList = new CAD2DBoundaryList();
v2DBList.BoundaryType = 7;// Polyline type
CAD2DPolyline v2DPolyline = new CAD2DPolyline();
v2DBList.Add(v2DPolyline);
CAD2DPoint ent2DPoint;
DPoint Point;
for (int j = 0; j < pline.PolyPoints.Count; j++)
{
Point = (DPoint)pline.PolyPoints[j];
ent2DPoint = new CAD2DPoint(Point.X, Point.Y);
v2DPolyline.Vertexes.Add(ent2DPoint);
}
v2DPolyline.Closed = true;
entGrHatch .Color = Color.Coral;
entGrHatch .GradientColor = Color.Azure;
entGrHatch .Boundaries.Add(v2DBList);
Thanks a lot.
Elena