Class ShapeSegment

Class ShapeSegment

Namespace: Aspose.Imaging
Assembly: Aspose.Imaging.dll (25.7.0)

Represents a shape segment. A segment is a line or curve connecting two points.

public abstract class ShapeSegment
   {
       protected double _x;
       protected double _y;
       public double X
       {
           get => _x;
           set => _x = value;
       }
       public double Y
       {
           get => _y;
           set => _y = value;
       }
   }

Inheritance

object ShapeSegment

Derived

LineSegment

Inherited Members

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

ShapeSegment()

protected ShapeSegment()
   {
   }

Properties

EndPoint

Gets the ending point.

public abstract PointF EndPoint
   {
      get;
   }

Property Value

PointF

StartPoint

Gets the starting point.

public abstract PointF StartPoint
   {
      get;
   }

Property Value

PointF

Methods

Equals(object)

Check if objects are equal.

public override bool Equals(object obj)
{
}
In this case, no changes were needed as the provided code is already correctly formatted according to C# conventions.

Parameters

obj object

The other object.

Returns

bool

The equality comparison result.

Equals(ShapeSegment)

Check if objects are equal.

protected bool Equals(ShapeSegment other)
{
    if (other == null) return false;
    if (ReferenceEquals(this, other)) return true;
    return this.Type == other.Type &&
           this.StartPoint.X == other.StartPoint.X &&
           this.StartPoint.Y == other.StartPoint.Y &&
           this.EndPoint.X == other.EndPoint.X &&
           this.EndPoint.Y == other.EndPoint.Y;
}

Parameters

other ShapeSegment

The other object.

Returns

bool

The equality comparison result.

GetHashCode()

Get hash code of the current object.

public override int GetHashCode()
    {
    }

Returns

int

The hash code.

 English