![]() |
![]() |
Segment.GetBendPoints
Function GetBendPoints(Offset1 As Double, Offset2 As Double, [OffsetType As cdrSegmentOffsetType = cdrParamSegmentOffset]) As Long
Member of Segment
The GetBendPoints method returns the number of bend points in a curve segment. A bend point is the offset where a curve segment bends (that is, where it changes its curvature from positive to negative). There can be a maximum of two bend points per segment, and possibly none.
Parameters
|
Description
|
Offset1
|
Returns the offset, in document units, of the first bend point
|
Offset2
|
Returns the offset, in document units, of the second bend point
|
OffsetType
|
Specifies the type of offset of a point on a curves subpath. This parameter returns cdrSegmentOffsetType.
This parameter is optional, and its default value is cdrParamSegmentOffset (2).
|
The following code example marks all bend points in the selected curve with small circles:
Sub Test() Dim seg As Segment Dim t1 As Double, t2 As Double, n As Long For Each seg In ActiveShape.Curve.Segments n = seg.GetBendPoints(t1, t2) If n > 1 Then MarkPoint seg, t2 If n > 0 Then MarkPoint seg, t1 Next seg End Sub Private Sub MarkPoint(seg As Segment, t As Double) Dim x As Double, y As Double Dim s As Shape seg.GetPointPositionAt t, , x, y Set s = ActiveLayer.CreateEllipse2(x, y, 0.03) s.Fill.UniformColor.RGBAssign 255, 255, 0 End Sub
![]() |
![]() |
![]() |
Copyright 2007 Corel Corporation. All rights reserved.