This method draws a rectangle.

[Visual Basic] Public Function DrawRectangle(rect As System.Windows.Rect) As Boolean
[C#]public bool DrawRectangle(System.Windows.Rect rect);

Parameters

rect

The System.Windows.Rect structure designating where the rectangle is drawn.

Return Value

Returns True if successful, otherwise returns False.

Explanation

The DrawRectangle method draws a rectangle. To draw a rectangle, set appropriate values in the PenWidth, ForeColor, ForeColorOpacity, BackColor, BackColorOpacity, and Fill properties. Set the values for the coordinate location and size of the rectangle in the DrawRectangle method's rect parameter. When the DrawRectangle method is executed, the rectangle will be drawn. If a portion of the rectangle lies outside the ImageKit control and the LimitAnnotationPosition property or LimitDrawPosition property are true, the rectangle will be resized to fit completely within the ImageKit control.

To delete the rectangle drawn with the DrawRectangle method, right click the object and display the context menu, the select "Undo" or execute the Undo method.

The DrawRectangle method can be used without setting the EditKind property to KindOfEdit.Rectangle.

It is also possible to draw a rectangle by setting the EditKind property to KindOfEdit.Rectangle then, on the base image displayed in the ImageKit control, use the mouse. For more details, please refer to the Edit Overview.

See also

ImageKit.Edit Members | Newtone.ImageKit.Wpf.ImageKit

 

The ImageKit WPF is created by Newtone Corporation