ImageGear .NET v25.0 - Updated
CleanBorders Method
Example 




ImageGear.Processing.Advanced Assembly > ImageGear.Processing.ImageClean Namespace > ImGearIC Class : CleanBorders Method
1-bit ImGearPage object to apply the method to.
Clean borders options.
Detects and removes large black regions located near the borders of the page.
Syntax
'Declaration
 
Public Shared Sub CleanBorders( _
   ByVal page As ImGearPage, _
   ByVal cleanBorderOptions As ImGearICBorderOptions _
) 
'Usage
 
Dim page As ImGearPage
Dim cleanBorderOptions As ImGearICBorderOptions
 
ImGearIC.CleanBorders(page, cleanBorderOptions)
public static void CleanBorders( 
   ImGearPage page,
   ImGearICBorderOptions cleanBorderOptions
)
public: static void CleanBorders( 
   ImGearPage* page,
   ImGearICBorderOptions* cleanBorderOptions
) 
public:
static void CleanBorders( 
   ImGearPage^ page,
   ImGearICBorderOptions^ cleanBorderOptions
) 

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
// 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);
' 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

Reference

ImGearIC Class
ImGearIC Members
ImGearPage Class
ImGearICBorderOptions Class