ClearImage .NET API
Copy Method (ImageEditor)
Example 





Inlite.ClearImageNet Namespace > ImageEditor Class : Copy Method
Image is copied from this ImageEditor object
Copies image from another ImageEditor object
Syntax
'Declaration
 
Public Sub Copy( _
   ByVal source As ImageEditor _
) 
'Usage
 
Dim instance As ImageEditor
Dim source As ImageEditor
 
instance.Copy(source)
public void Copy( 
   ImageEditor source
)
public procedure Copy( 
    source: ImageEditor
); 
public function Copy( 
   source : ImageEditor
);
public:
void Copy( 
   ImageEditor^ source
) 

Parameters

source
Image is copied from this ImageEditor object
Remarks

Copies image pixels and properties from source.Image image to this object.Image. If source.Zone is set only zone area of the source image is copied. 

Example
void ImageMethods(string imageFile, string imageFileOut)
{
    ImageEditor editor = new ImageEditor();
    ImageEditor editorCenter = new ImageEditor();
    try
    {
        // Open image file
        editor.Image.Open(imageFile, 1);
        // Crop area of the image
        editor.Crop(100, 200, 800, 1000);
        // Convert to grayscale
        editor.ToGrayscale();
        // Create a zone in the upper left corner
        editor.Zone = new System.Drawing.Rectangle(0, 0, editor.Width / 2, editor.Height / 2);
        // Invert center area of the image
        editor.Clear();
        // Create a zone in the center of the image
        editor.Zone = new System.Drawing.Rectangle(editor.Width / 3, editor.Height / 3, editor.Width / 3, editor.Height / 3);
        // Invert center area of the image
        editor.Invert();
        // Duplicate center area to a new image
        editorCenter.Copy(editor);
        // Convert image to bi-tonal
        editorCenter.ToBitonal();
        //  Remove zone from the editor image
        editor.Zone = new System.Drawing.Rectangle();
        //  Save processed image
        editor.Image.SaveAs(imageFileOut, Inlite.ClearImage.EFileFormat.ciEXT);
    }
    catch (ClearImageException ex)
    { Console.WriteLine(ex.Message); }
    finally
    {
        editor.Dispose();  editorCenter.Dispose(); // ClearImage V9 and later
    }
}
See Also

Reference

ImageEditor Class
ImageEditor Members