GdPicture.NET Reference Guide
ConvertTo1BppBradley Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : ConvertTo1BppBradley Method
GdPicture Image Identifier.
Value between [0 and 254]. Specifies the aggressiveness of the method. Suggested value is 38. Higher is the value, whiter the resulting bitmap will be.
Converts a GdPicture image to a 1-bit (black and white) bitmap using a modified Bradley adaptive thresholding method.
Syntax
'Declaration
 
Public Function ConvertTo1BppBradley( _
   ByVal ImageID As Integer, _
   ByVal Threshold As Byte _
) As GdPictureStatus
public GdPictureStatus ConvertTo1BppBradley( 
   int ImageID,
   byte Threshold
)
public function ConvertTo1BppBradley( 
    ImageID: Integer;
    Threshold: Byte
): GdPictureStatus; 
public function ConvertTo1BppBradley( 
   ImageID : int,
   Threshold : byte
) : GdPictureStatus;
public: GdPictureStatus ConvertTo1BppBradley( 
   int ImageID,
   byte Threshold
) 
public:
GdPictureStatus ConvertTo1BppBradley( 
   int ImageID,
   byte Threshold
) 

Parameters

ImageID
GdPicture Image Identifier.
Threshold
Value between [0 and 254]. Specifies the aggressiveness of the method. Suggested value is 38. Higher is the value, whiter the resulting bitmap will be.

Return Value

A member of the GdPictureStatus enumeration.
Example
Converting the image to a 1-bit per pixel image using adaptive thresholding.
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("input.png")
If imageId <> 0 Then
   oGdPictureImaging.ConvertTo1BppBradley(ImageID, 38)
   oGdPictureImaging.SaveAsTIFF(ImageID, "output.tif", TiffCompression.TiffCompressionCCITT4)
Else
   MessageBox.Show("Error: " + oGdPictureImaging.GetStat().ToString())
End If
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
FxBlackNWhite(Int32,BitonalReduction) Method
FxBlackNWhiteT Method
ConvertTo1Bpp(Int32) Method
ConvertTo1BppSauvola(Int32,Single) Method
ConvertTo1BppAT(Int32) Method