ImageGear v26.5 - Updated
ImageGear.Core Assembly / ImageGear.Processing Namespace / ImGearRasterProcessing Class / StretchContrast Method / StretchContrast(ImGearRasterPage,ImGearContrastModes,ImGearChannelRange) Method
Image to process.
One of the contrast processing modes: ImGearContrastModes.PALETTE, ImGearContrastModes.PIXEL, ImGearContrastModes.AUTO.
Channel range to process.
Example




In This Topic
    StretchContrast(ImGearRasterPage,ImGearContrastModes,ImGearChannelRange) Method
    In This Topic
    Stretches image contrast. Processes specified range of channels.
    Syntax
    'Declaration
     
    Public Overloads Shared Sub StretchContrast( _
       ByVal page As ImGearRasterPage, _
       ByVal mode As ImGearContrastModes, _
       ByVal channels As ImGearChannelRange _
    ) 
    'Usage
     
    Dim page As ImGearRasterPage
    Dim mode As ImGearContrastModes
    Dim channels As ImGearChannelRange
     
    ImGearRasterProcessing.StretchContrast(page, mode, channels)
    public static void StretchContrast( 
       ImGearRasterPage page,
       ImGearContrastModes mode,
       ImGearChannelRange channels
    )
    public: static void StretchContrast( 
       ImGearRasterPage* page,
       ImGearContrastModes mode,
       ImGearChannelRange channels
    ) 
    public:
    static void StretchContrast( 
       ImGearRasterPage^ page,
       ImGearContrastModes mode,
       ImGearChannelRange channels
    ) 

    Parameters

    page
    Image to process.
    mode
    One of the contrast processing modes: ImGearContrastModes.PALETTE, ImGearContrastModes.PIXEL, ImGearContrastModes.AUTO.
    channels
    Channel range to process.
    Remarks
    Can be applied only to raster pages with standard (non Run-Ends) DIB.

    If ContrastMode is equal to ImGearContrastModes.PALETTE, DIB must have a palette.

    Use ImGearRasterProcessingVerifier.CanApplyStretchContrast method to check whether the operation can be performed.

    Example
    // Channel range to adjust contrast.
    ImGearChannelRange igChannelRange = new ImGearChannelRange(0, igRasterPage.DIB.ChannelCount);
    // Stretch the contrast.
    ImGearRasterProcessing.StretchContrast(igRasterPage,
        ImGearContrastModes.AUTO, igChannelRange);
    ' Channel range to adjust contrast.
    Dim igChannelRange As New ImGearChannelRange(0, igRasterPage.DIB.ChannelCount)
    ' Stretch the contrast.
    ImGearRasterProcessing.StretchContrast(igRasterPage, ImGearContrastModes.AUTO, igChannelRange)
    See Also