ClearImage .NET API
Clear Method (ImageEditor)
Example 





Inlite.ClearImageNet Namespace > ImageEditor Class : Clear Method
Set all pixels to white
Syntax
'Declaration
 
Public Sub Clear() 
'Usage
 
Dim instance As ImageEditor
 
instance.Clear()
public void Clear()
public procedure Clear(); 
public function Clear();
public:
void Clear(); 
Remarks
If Zone is set only zone area is cleared
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