This method creates an Image object and displays the specified image.

[Visual Basic] Public Function PasteImage(filename As String, rect As Rectangle) As Boolean
[C#] public bool PasteImage(string filename, Rectangle rect);

Parameters

filename

The file name (full path) of the image to be displayed in the Image object

rect

The rectangle where the Image object is created

Return Value

Returns True if successful, otherwise returns False.

Explanation

The PasteImage method creates an Image object and displays the specified image.

The PasteImage's filename parameter contains the file name of the image that will be displayed in the Image object. Be sure to set the full path to the image. The PasteImage's rect parameter determines the location in the ImageKit control where the Image object will be created and this rectangle determines the size of the image. When the AspectRatio property is True the image will be displayed in the Image object while maintaining the image's height/width ratio. If the AspectRatio property is False, the image will be stretched to fill the Image object.

If a portion of the pasted image is outside of the ImageKit control and the LimitAnnotationPosition property and the LimitDrawPosition property are set to True, the image will be repositioned to fit completely within the ImageKit control.

To delete the image pasted with the PasteImage method, right click on the object and display the context menu, the select "Undo" or execute the Undo method.

The PasteImage method can be used without setting the EditKind property to KindOfEdit.Image.

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

Note: All images that can be loaded into the ImageKit control can also be pasted with the PasteImage method. If the selected file cannot be pasted, False will be returned. If the area set in the rect parameter is too large for the available memory to paste the image there, a small white image with a red x will appear instead. Please deleted the image object using "Delete" or "Undo" in the context menu and paste a smaller image object.

Also See

ImageKit.Edit Members | Newtone.ImageKit.Win.ImageKit

 

The ImageKit.NET3 is created by Newtone Corporation