RemoveLines(Int32,LineRemoveOrientation,Int32,Int32,Int32,Int32,Boolean) Method
Performs line removal on a GdPicture image or on an area of a GdPicture image defined by SetROI() method.
'Declaration
Public Overloads Function RemoveLines( _
ByVal As Integer, _
ByVal As LineRemoveOrientation, _
ByVal As Integer, _
ByVal As Integer, _
ByVal As Integer, _
ByVal As Integer, _
ByVal As Boolean _
) As GdPictureStatus
Parameters
- ImageID
- GdPicture image identifier. Only 1 bit per pixel images with black and white palette are supported.
- Orientation
- A member of LineRemoveOrientation enumeration specifying whether to remove horizontal or vertical lines.
- MaxLineGap
- Maximum Gap size in the line for it to be considered as a line. If set to 0, no gaps are allowed in the line. If set to -1, gaps calculation is irrelevant to the line equation. Default value is -1.
- MaxLineThickness
- Maximum thickness of a line allowed at any area of the line. If the line is thicker than this value, the line will not be removed. Range from 1 to 50. Default value is 8.
- MinLineLength
- Minimum Length allowed for the line to be removed. Only lines with a length equal to or bigger than this value will be removed. Range from 1 to Image Width if Horizontal, and from 1 to Image Height if Vertical Line. Default valus is 75.
- MaxInterception
- Maximum Character Interception of the Line. If characters intercepting the line have a size of interception larger than this value, the line will not be removed. Range from 0 to MinLineLength / 2. Default value is 8.
- ReConnectBrokenCharacters
- Whether to reconnect characters that are broken upon the lines removal or keep the gaps where the line was. Default value is false.
Return Value
A member of the GdPictureStatus enumeration.
Removing lines from a black and white tiff image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
// LoadInMemory parameter is set to true in order to be able to update the input file.
int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.tif", true);
// Remove vertical and horizontal lines using default parameters.
gdpictureImaging.RemoveLines(imageID, LineRemoveOrientation.Horizontal | LineRemoveOrientation.Vertical, -1, 8, 75, 8, false);
gdpictureImaging.SaveAsTIFF(imageID, "image.tif", TiffCompression.TiffCompressionCCITT4);
gdpictureImaging.ReleaseGdPictureImage(imageID);
}