Declaration
procedure SetPoints(StartX, StartY, EndX, EndY: Double; PointBase: TIEPointBase = iepbBitmap; SnapAngles: Boolean = False; FixToStartPt: Boolean = True);
procedure SetPoints(Points: array of TPoint; PointBase: TIEPointBase = iepbBitmap; SnapAngles: Boolean = False; FixToStartPt: Boolean = True); overload;
procedure SetPoints(Index: Integer; X, Y: Integer; PointBase: TIEPointBase = iepbBitmap; SnapAngles: Boolean = False; FixToStartPt: Boolean = True); overload;
Description
Provides an alternate method to set the position of a line, by specifying its start and end points. The points are expressed by starting ending Points.
It is the same as setting
LinePoint 1 and 2, but provides some extra parameters.
Parameter | Description |
StartX, StartY | The start point of the line |
EndX, EndY | The end point of the line |
SnapAngles | Set to true to adjust the angle to ensure it aligns with LayersRotateStep (e.g. force it to 45 deg. steps) |
FixToStartPt | If we are moving an existing line, which point should not move, the starting or ending point? (Only relevant if SnapAngles = True) |
Example
// Create a line from 100,100 to 200,200
ImageEnView1.LayersAdd( ielkLine );
TIELineLayer( ImageEnView1.CurrentLayer ).SetPoints( 100, 100, 200, 200 );
ImageEnView1.Update();
// Which is the same as...
ImageEnView1.LayersAdd( 100, 100, 200, 200 );
// Which is the same as...
ImageEnView1.LayersAdd( ielkLine );
TIELineLayer( ImageEnView1.CurrentLayer ).LinePoint1 := Point( 100, 100 );
TIELineLayer( ImageEnView1.CurrentLayer ).LinePoint2 := Point( 200, 200 );
ImageEnView1.Update();
See Also
-
LinePoint1-
LinePoint2-
LineLength-
Points-
GetPointEx