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





In This Topic
    ConvertTo1Bpp(Int32) Method
    In This Topic
    Converts a GdPicture image to a 1-bit BW indexed color image. The color table has 2 entries: 1 Black & 1 White.
    Syntax
    'Declaration
     
    
    Public Overloads Function ConvertTo1Bpp( _
       ByVal ImageID As Integer _
    ) As GdPictureStatus
    public GdPictureStatus ConvertTo1Bpp( 
       int ImageID
    )
    public function ConvertTo1Bpp( 
        ImageID: Integer
    ): GdPictureStatus; 
    public function ConvertTo1Bpp( 
       ImageID : int
    ) : GdPictureStatus;
    public: GdPictureStatus ConvertTo1Bpp( 
       int ImageID
    ) 
    public:
    GdPictureStatus ConvertTo1Bpp( 
       int ImageID
    ) 

    Parameters

    ImageID
    GdPicture image identifier.

    Return Value

    A member of the GdPictureStatus enumeration.
    Remarks
    Is equivalent to ConvertTo1Bpp(ImageID, 128).
    Example
    Converts selected image to a 1-bit BW indexed color image, and saves result into a TIF file.
    using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
    {
        // Open an image file. An empty string allows the control to prompt for selecting a file.
        int imageID = gdpictureImaging.CreateGdPictureImageFromFile("");
     
        gdpictureImaging.ConvertTo1Bpp(imageID);
        gdpictureImaging.SaveAsTIFF(imageID, "output.tif", TiffCompression.TiffCompressionAUTO);
     
        // Release used resources.
        gdpictureImaging.ReleaseGdPictureImage(imageID);
    }
    See Also