ImageGear for .NET
CleanBorders Method
See Also  Example Send Feedback
ImageGear21.Processing.Advanced Assembly > ImageGear.Processing.ImageClean Namespace > ImGearIC Class : CleanBorders Method




page
1-bit ImGearPage object to apply the method to.
cleanBorderOptions
Clean borders options.

Glossary Item Box

Detects and removes large black regions located near the borders of the page.

Syntax

 
Visual Basic
C#
Managed Extensions for C++
C++/CLI
 
 

Parameters

page
1-bit ImGearPage object to apply the method to.
cleanBorderOptions
Clean borders options.

Remarks

nLeftBorderSize, nRightBorderSize, nTopBorderSize and nBottomBorderSize parameters of ImGearICBorderOptions set maximum size of all borders. It means the pixels that lie outside of the borders will not be deleted. But it doesn't mean that all pixels in the borders will be deleted. nMinLinesNum and nMinLineWidth parameters of ImGearICBorderOptions inform the method which objects in the borders should be deleted - only the black objects that have more than or equal to the number of lines specified with width, not less than specified, will be deleted. As for the left and right borders, objects lines are actually parts of screen lines, but as for top and bottom borders those lines are screen columns.

If cleanBorderOptions parameter is null, then the method automatically detects and removes large black regions near the borders of the page. These black borders can result from scanning an image that was reproduced with a copier onto paper that was larger than the image itself.

Example

C#Copy Code
// Sets options for border cleaning and then applies them.
ImGearICBorderOptions igICBorderOptions = new ImGearICBorderOptions();
igICBorderOptions.nBottomBorderSize = 100;
igICBorderOptions.nLeftBorderSize = 100;
igICBorderOptions.nRightBorderSize = 120;
igICBorderOptions.nTopBorderSize = 100;
igICBorderOptions.nMinLinesNum = 10;
igICBorderOptions.nMinLineWidth = 10;
// Clean the borders using the options.
ImGearIC.CleanBorders(igRasterPage, igICBorderOptions);
Visual BasicCopy Code
' Sets options for border cleaning and then applies them.
Dim igICBorderOptions As New ImGearICBorderOptions()
igICBorderOptions.nBottomBorderSize = 100
igICBorderOptions.nLeftBorderSize = 100
igICBorderOptions.nRightBorderSize = 120
igICBorderOptions.nTopBorderSize = 100
igICBorderOptions.nMinLinesNum = 10
igICBorderOptions.nMinLineWidth = 10
' Clean the borders using the options.
ImGearIC.CleanBorders(igRasterPage, igICBorderOptions)

See Also

©2013. Accusoft Corporation. All Rights Reserved.