Reference Guide
GdPicture14 Namespace / GdPictureImaging Class / ConvertTo1BppAT Method / ConvertTo1BppAT(Int32) Method
GdPicture image identifier.
Example





In This Topic
    ConvertTo1BppAT(Int32) Method
    In This Topic
    Converts a GdPicture image to a 1-bit (black and white) bitmap using a variant of the Otsu adaptive thresholding method. This method is particularly efficient on documents with contrasted foreground and background.
    Syntax
    'Declaration
     
    
    Public Overloads Function ConvertTo1BppAT( _
       ByVal ImageID As Integer _
    ) As GdPictureStatus
    public GdPictureStatus ConvertTo1BppAT( 
       int ImageID
    )
    public function ConvertTo1BppAT( 
        ImageID: Integer
    ): GdPictureStatus; 
    public function ConvertTo1BppAT( 
       ImageID : int
    ) : GdPictureStatus;
    public: GdPictureStatus ConvertTo1BppAT( 
       int ImageID
    ) 
    public:
    GdPictureStatus ConvertTo1BppAT( 
       int ImageID
    ) 

    Parameters

    ImageID
    GdPicture image identifier.

    Return Value

    A member of the GdPictureStatus enumeration.
    Example
    Converting the image to black and white using a variant of the Otsu adaptive thresholding methods.
    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);
     
        //Convert to black and white.
        gdpictureImaging.ConvertTo1BppAT(imageID);
        gdpictureImaging.SaveAsTIFF(imageID, "image.tif", TiffCompression.TiffCompressionAUTO);
        gdpictureImaging.ReleaseGdPictureImage(imageID);
    }
    See Also