#include "BITIFF.H"
int CALLBACK FindBlackPage( LPCTSTR szTiffFileName,
int nRatio,
int iPage
RGBLIMIT sBlankLimit)
Description
This function searchs the specified "szTiffFileName" single page or multi-page TIFF file for black pages based on the ratio of black and white pixels on the page.
If it finds a black page the function will return the offset in 1 base numbering. This function works for only 1, 8, and 24 bit per pixel images.
Parameters
|
LPCTSTR |
HDib |
The TIFF file name path. |
|
Int |
nRatio |
The ratio of black and white pixels on the page in 0.1 percent units. For example 100 is 10 percent ratio black pixels on the white background. Boundary values are 0 to 1000 inclusive. |
|
int |
iPage |
Zero based page number. The function starts searching from this page in the image file. This value must be 0 and number of pages in the image file - 1. |
|
RGBLIMIT |
sBlankLimit |
This parameter is noticed for 8 and 24 bit per pixel images. The structure contains the RGB limit components for black page detecting. For example if lRed = 240, lGreen = 240, lBlue = 240 and the RGB components value of current pixel of the image are less than 240 then thepixel is a black pixel. |
Additional Information
This example shows how to use the dll when loading statically including the header file. Otherwise if the dll is loaded dynamically, for further information read the “About the difference of static and dynamic library loading” section of the manual.
Return values
-1 - On error. Use TiffErrorString to retrieve the error string for the failure.
> 0 - The 1 based offset of the page in the TIFF file.
0 - There are no black pages in the TIFF file.
Requirements
Header : Declared in BiTiff.h; include BiTiff.h.
Library : Use BiTIFF.lib.
DLLs : BiTiff.dll.