[]
        
(Showing Draft Content)

GrapeCity.Documents.Imaging.GcBitmap.ToGrayscaleBitmap

ToGrayscaleBitmap Method

ToGrayscaleBitmap(ColorChannel, bool)

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(ColorChannel, bool) 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(GrayscaleBitmap, ColorChannel) method instead.

Declaration
public GrayscaleBitmap ToGrayscaleBitmap(ColorChannel colorChannel = ColorChannel.Blue, bool whiteIsZero = false)
Public Function ToGrayscaleBitmap(Optional colorChannel As ColorChannel = ColorChannel.Blue, Optional whiteIsZero As Boolean = False) As GrayscaleBitmap
Parameters
Type Name Description
ColorChannel colorChannel

The color channel used as the source of grayscale data.

bool whiteIsZero

If true, indicates that 0 represents white and 255 represents black in the resulting GrayscaleBitmap.

Returns
Type Description
GrayscaleBitmap

A new instance of GrayscaleBitmap.