Click or drag to resize
DigitalRuneStrokedSegment2F Class
Wraps a 2D curve segment (single-precision) and determines whether it is stroked or not.
Inheritance Hierarchy
SystemObject
  DigitalRune.GraphicsStrokedSegmentSingle, Vector2F
    DigitalRune.GraphicsStrokedSegment2F

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public class StrokedSegment2F : StrokedSegment<float, Vector2F>

The StrokedSegment2F type exposes the following members.

Constructors
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFlatten
Computes the points of a sequence of line segments which approximate the curve.
(Inherited from StrokedSegmentTParam, TPoint.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLength
Computes the approximated length of the curve for the parameter interval [start, end].
(Inherited from StrokedSegmentTParam, TPoint.)
Public methodGetPoint
Computes a point on the curve.
(Inherited from StrokedSegmentTParam, TPoint.)
Public methodGetTangent
Computes the tangent for a point on the curve.
(Inherited from StrokedSegmentTParam, TPoint.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
Remarks
Curve segments within a PathFigure2F are stroked by default. The StrokedSegmentTParam, TPoint is a decorator that wraps another curve and adds an annotation that defines whether the curve is stroke or not.
Examples

The following example creates rectangles where all or only some edges are stroked:

C#
// Box where all edges are stroked. (Curve segments are stroked by default.)
var boxFigure1 = new PathFigure2F
{
  Segments =
  {
    new LineSegment2F { Point1 = new Vector2F(0, 0), Point2 = new Vector2F(0, 1) },
    new LineSegment2F { Point1 = new Vector2F(0, 1), Point2 = new Vector2F(1, 1) },
    new LineSegment2F { Point1 = new Vector2F(1, 1), Point2 = new Vector2F(1, 0) },
    new LineSegment2F { Point1 = new Vector2F(1, 0), Point2 = new Vector2F(0, 0) }
  }
};
var figureNode1 = new FigureNode(boxFigure1)
{
  StrokeColor = new Vector3F(0, 0, 0),
  StrokeThickness = 2,
  FillColor = new Vector3F(0.5f, 0.5f, 0.5f)
};

// Box where top and bottom edges are stroked.
var boxFigure2 = new PathFigure2F
{
  Segments =
  {
    new StrokedSegment2F(
      new LineSegment2F { Point1 = new Vector2F(0, 0), Point2 = new Vector2F(0, 1) }, 
      false),
    new LineSegment2F { Point1 = new Vector2F(0, 1), Point2 = new Vector2F(1, 1) },
    new StrokedSegment2F(
      new LineSegment2F { Point1 = new Vector2F(1, 1), Point2 = new Vector2F(1, 0) }, 
      false),
    new LineSegment2F { Point1 = new Vector2F(1, 0), Point2 = new Vector2F(0, 0) }
  }
};
var figureNode2 = new FigureNode(boxFigure2)
{
  StrokeColor = new Vector3F(0, 0, 0),
  StrokeThickness = 2,
  FillColor = new Vector3F(0.5f, 0.5f, 0.5f)
};
See Also