This method sets the coordinates of the selected object.
Parameters
setPoints
The set of coordinate points of the selected object. A value of
type System.Collections.Generic.List<Point>
Values cannot be negative.
Return Value
Returns True if successful, otherwise returns False.
Explanation
The SetSelectedObjectDrawPoints method sets the list of coordinate points for the selected object. It is possible to the individual points and alter the shape of the object or to move the object by increasing or decreasing all points by the same amount. If an object has not been selected, this method returns False.
When using this method on Rectangle, Image, and Text objects,the coordinates used will be the coordinates of the rectangle when the objects have a ZERO rotation. If the selected object has an angle of rotation other than 0 (If the SelectedObjectAngle value is not 0), then the drawing result of executing this method will be the object drawn at its new coordinates with a zero rotation and then the object rotated by the amount set in the SelectedObjectAngle property. (If this rotation results in some of the objects points having negative values, then the entire object will be shifted so that no points have negative values.)
Changing the actual coordinate point values of an object can only be done using this method. Even though you can select an object, and move it with the mouse, or right click the object to display the context menu and select "Properties" to display that object's Properties Dialog, you cannot and set the actual coordinate points in any other way than to use this method.
The coordinate values and the conditions under which they can be set depends on the type of object selected. They are as follows:
- Line: Coordinates of the start point and end point. The number of List elements is 2.
- Rectangle, Image: Coordinates for (Left, Top) and (Right, Bottom). The number of List elements is 2.
- Ellipse: The (Left, Top)a nd (Right, Bottom) coordinates of the rectangle that bounds the ellipse. The number of List elements is 2.
- Text: If the selected Text object's WordWrap property is True, then the (Left, Top) and (Right, Bottom) coordinates Text object's rectangle. The number of List elements is 2. If the Text object's WordWrap property is False, then the coordinates for the start point (Left, Top). The number of List elements is 1.
- Polygon: A list of the start and end points for each line in the polygon. The number of List elements will equal the number of lines in the polygon. The minimum number of elements is 3.
- Polyline, Pen: A list of the start and end points for each line in the polyline. The number of List elements will equal the number of lines in the polyline + 1. The minimum number of elements is 2.
If the number of elements set in the List is less than the minimum number specified above, the SetSelectedObjectDrawPoints method will return False. For Line, Rectangle, Ellipse, Text, and Image objects, if the number of elements set in the List is greater than the number of elements required, the additional elements will be ignored and the object drawn using the required number of elements that are first in the list.
For Polygon, Polyline, and Pen objects, the number of elements in the list can be increased or decreased as long as the number of elements are not less than the minimum required for that object.
If the values set in the coordinates are not correct values (i.e. they are negative or in the case of an image object, larger than the base image), or if they don't fit the above conditions, the objects will not be drawn and this method will return False.
For Rectangle, Ellipse, adn Image objects with rotation angles other than zero, if the coordinate values set with this method result in one or more coordinate points falling outside the visible area (i.e. negative coordinate values), then the object will be drawn but it will be shifted so that all points fall within the visible area.
Also See
ImageKit.Edit Members | Newtone.ImageKit.Win.ImageKit