IsBlank(Int32,Single,Boolean,Boolean) Method
Detects if a GdPicture image or on an area of a GdPicture image defined by SetROI() method is blank, with option to account for margins.
public bool IsBlank(
int ,
float ,
bool ,
bool
)
public function IsBlank(
: Integer;
: Single;
: Boolean;
: Boolean
): Boolean;
public function IsBlank(
: int,
: float,
: boolean,
: boolean
) : boolean;
public: bool IsBlank(
int ,
float ,
bool ,
bool
)
public:
bool IsBlank(
int ,
float ,
bool ,
bool
)
'Declaration
Public Overloads Function IsBlank( _
ByVal As Integer, _
ByVal As Single, _
ByVal As Boolean, _
ByVal As Boolean _
) As Boolean
Parameters
- ImageID
- GdPicture image identifier.
- Confidence
- Confidence threshold in the range [0 - 100]. Suggested value is 99.5.
- AccountForMargins
- Specifies if the algorithm must drop the margins during the calculation (slower). Yields more accurate results for images with margins. Default value is true.
- AccountForPunchHoles
- Specifies if the algorithm must drop the punch holes during the calculation (slower). Yields more accurate results for images with punch holes. Default value is true.
Return Value
True if it is a blank image, else False.
Removing the blank pages from a tiff document.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
// LoadInMemory parameter is set to true in order to be able to update the input file.
int imageID = gdpictureImaging.TiffCreateMultiPageFromFile("multipage.tif", true);
int pageCount = gdpictureImaging.TiffGetPageCount(imageID);
int pageNo = 1;
while (pageNo <= pageCount)
{
gdpictureImaging.TiffSelectPage(imageID, pageNo);
if (gdpictureImaging.IsBlank(imageID, 95, false, false))
{
gdpictureImaging.TiffDeletePage(imageID, pageNo);
pageCount--;
}
else
{
pageNo++;
}
}
gdpictureImaging.TiffSaveMultiPageToFile(imageID, "multipage.tif", TiffCompression.TiffCompressionAUTO);
gdpictureImaging.ReleaseGdPictureImage(imageID);
}