GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / IsBlank Method / IsBlank(Int32,Single,Boolean,Boolean) Method
GdPicture image identifier.
Confidence threshold in the range [0 - 100]. Suggested value is 99.5.
Specifies if the algorithm must drop the margins during the calculation (slower). Yields more accurate results for images with margins. Default value is true.
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.
Example





In This Topic
IsBlank(Int32,Single,Boolean,Boolean) Method
In This Topic
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.
Syntax
'Declaration
 
Public Overloads Function IsBlank( _
   ByVal ImageID As Integer, _
   ByVal Confidence As Single, _
   ByVal AccountForMargins As Boolean, _
   ByVal AccountForPunchHoles As Boolean _
) As Boolean
public bool IsBlank( 
   int ImageID,
   float Confidence,
   bool AccountForMargins,
   bool AccountForPunchHoles
)
public function IsBlank( 
    ImageID: Integer;
    Confidence: Single;
    AccountForMargins: Boolean;
    AccountForPunchHoles: Boolean
): Boolean; 
public function IsBlank( 
   ImageID : int,
   Confidence : float,
   AccountForMargins : boolean,
   AccountForPunchHoles : boolean
) : boolean;
public: bool IsBlank( 
   int ImageID,
   float Confidence,
   bool AccountForMargins,
   bool AccountForPunchHoles
) 
public:
bool IsBlank( 
   int ImageID,
   float Confidence,
   bool AccountForMargins,
   bool AccountForPunchHoles
) 

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.
Remarks
Use the GetStat() method to check if this method has completed successfully.
Example
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);
}
See Also