public void CompoundCurve() { hCompoundCurve crv = new hCompoundCurve(); hShape shape = new hShape("p" + Index); hPath path = new hPath(); GroupCheck(Shapes); foreach (wShape Shape in Shapes.Shapes) { hCubicBezierSpline spline = AddSpline((wBezierSpline)Shape.Curve); crv.AddCurve(spline); } shape.SetShape(crv); shape.AddAttribute(new hBoolean(hBoolean.FillRule.evenodd).Value); shape = SetGraphics(shape, Shapes.Graphics); if (Shapes.Effects.HasEffect) { hFilter filter = SetEffects(Shapes.Effects, Index); PathSet[Shapes.Group].Append(filter.Value); shape.AddAttribute(filter.ApplyFilter()); } path = new hPath(shape); PathSet[Shapes.Group].Append(path.svgPath); }
public void AddShape() { hShape shape = new hShape("p" + Index); hPath path = new hPath(); GroupCheck(Shapes); switch (Shapes.Type) { case "Arc": AddArc((wArc)Shapes.Shapes[0].Curve); break; case "Circle": shape.SetShape(AddCircle((wCircle)Shapes.Shapes[0].Curve)); break; case "Ellipse": wEllipse tempEllipse = (wEllipse)Shapes.Shapes[0].Curve; shape.SetShape(AddEllipse(tempEllipse)); shape.AddAttribute(new hTransform(new hRotate(tempEllipse.Center, tempEllipse.Rotation).Transformation).Transformation); break; case "Line": shape.SetShape(AddLine((wLine)Shapes.Shapes[0].Curve)); break; case "Polyline": shape.SetShape(AddPolyline((wPolyline)Shapes.Shapes[0].Curve)); break; case "BezierSpline": shape.SetShape(AddSpline((wBezierSpline)Shapes.Shapes[0].Curve)); break; default: break; } shape = SetGraphics(shape, Shapes.Graphics); if (Shapes.Effects.HasEffect) { hFilter filter = SetEffects(Shapes.Effects, Index); PathSet[Shapes.Group].Append(filter.Value); shape.AddAttribute(filter.ApplyFilter()); } path = new hPath(shape); PathSet[Shapes.Group].Append(path.svgPath); }
private hShape SetGraphics(hShape HoopoeShape, wGraphic Graphics) { HoopoeShape.AddAttribute(new hStrokeColor(Graphics.StrokeColor).Value); HoopoeShape.AddAttribute(new hStrokeWeight(Graphics.StrokeWeight[0]).Value); HoopoeShape.AddAttribute(new hStrokeOpacity(Graphics.StrokeColor.A).Value); HoopoeShape.AddAttribute(new hStrokePattern(Graphics.StrokePattern).Value); HoopoeShape.AddAttribute(new hStrokeCap((hStrokeCap.StrokeCap)Graphics.StrokeCap).Value); HoopoeShape.AddAttribute(new hStrokeCorner((hStrokeCorner.StrokeCorner)Graphics.StrokeCorner).Value); HoopoeShape.AddAttribute(new hStrokeMitre(89).Value); switch (Graphics.FillType) { case wGraphic.FillTypes.Solid: HoopoeShape.AddAttribute(new hFillColor(Graphics.Background).Value); HoopoeShape.AddAttribute(new hFillOpacity(Graphics.Background.A).Value); break; case wGraphic.FillTypes.Pattern: HoopoeShape.AddAttribute(new hFillColor(Graphics.Background).Value); HoopoeShape.AddAttribute(new hFillOpacity(Graphics.Background.A).Value); break; case wGraphic.FillTypes.LinearGradient: hFillGradientLinear Gradient = new hFillGradientLinear(Index, Graphics.Gradient); Styles.Append(Gradient.Style); HoopoeShape.AddAttribute(Gradient.Value); break; case wGraphic.FillTypes.RadialGradient: hFillGradientRadial RGradient = new hFillGradientRadial(Index, Graphics.Gradient); Styles.Append(RGradient.Style); HoopoeShape.AddAttribute(RGradient.Value); break; case wGraphic.FillTypes.Bitmap: hFillBitmap hBitmapFill = new hFillBitmap(Index, Graphics.FillBitmap, Shapes.Boundary.Width, Shapes.Boundary.Height); Styles.Append(hBitmapFill.Style); HoopoeShape.AddAttribute(hBitmapFill.Value); break; } return(HoopoeShape); }