Document Solutions for Imaging
GrapeCity.Documents.Imaging Assembly / GrapeCity.Documents.Imaging Namespace / GcBitmap Class / ToGrayscaleBitmap Method
The color channel used as the source of grayscale data.
If true, indicates that 0 represents white and 255 represents black in the resulting GrayscaleBitmap.

In This Topic
    ToGrayscaleBitmap Method
    In This Topic
    Creates a GrayscaleBitmap from the current GcBitmap.

    This method does not perform any transformations of the color palette. It is expected that the source GcBitmap has already been converted to grayscale palette using a GrayscaleEffect or something like that. Alternatively, you can use this method to extract individual channels of a color image without any prior conversion, and treat the resulting GrayscaleBitmap simply as a representation of some image data with 8 bits per pixel. The ToGrayscaleBitmap method just copies data from a specified color channel to a new instance of the GrayscaleBitmap class. If you need to copy some color channel to an existing instance of GrayscaleBitmap, use the ExportColorChannel method instead.

    Syntax
    'Declaration
     
    Public Function ToGrayscaleBitmap( _
       Optional ByVal colorChannel As ColorChannel, _
       Optional ByVal whiteIsZero As System.Boolean _
    ) As GrayscaleBitmap
    public GrayscaleBitmap ToGrayscaleBitmap( 
       ColorChannel colorChannel,
       System.bool whiteIsZero
    )

    Parameters

    colorChannel
    The color channel used as the source of grayscale data.
    whiteIsZero
    If true, indicates that 0 represents white and 255 represents black in the resulting GrayscaleBitmap.

    Return Value

    A new instance of GrayscaleBitmap.
    See Also