ImageGear .NET v25.2 - Updated
InvertContrast(ImGearRasterPage) Method
Example 




ImageGear.Core Assembly > ImageGear.Processing Namespace > ImGearRasterProcessing Class > InvertContrast Method : InvertContrast(ImGearRasterPage) Method
Image to invert contrast.
Inverts image contrast.
Syntax
'Declaration
 
Public Overloads Shared Sub InvertContrast( _
   ByVal page As ImGearRasterPage _
) 
'Usage
 
Dim page As ImGearRasterPage
 
ImGearRasterProcessing.InvertContrast(page)
public static void InvertContrast( 
   ImGearRasterPage page
)
public: static void InvertContrast( 
   ImGearRasterPage* page
) 
public:
static void InvertContrast( 
   ImGearRasterPage^ page
) 

Parameters

page
Image to invert contrast.
Remarks
If the image is indexed and the palette is not grayscale, this method modifies image's palette, otherwise it modifies image's pixels. The method processes only color channels.

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

Example
// Detect an area around a point in an image based upon a base pixel and threshold.

// Top left corner of image
ImGearPoint igPoint = new ImGearPoint(0, 0);
//Get the Pixel currently there.
ImGearPixel igPixel = igRasterPage.DIB.GetPixelCopy(0, 0);
// Detection class, threshold is difference in pixel channel values from specified pixel.
ImGearPixelCheckerThreshold igPixelCheckerThreshold = new ImGearPixelCheckerThreshold(igPixel, 100);
// Detect the region around target point within the threshold.
ImGearEffects.DetectArea(igRasterPage, igPoint, igPixelCheckerThreshold);

// Invert the contrast of the selected region to visible show the detected region.
ImGearRasterProcessing.InvertContrast(igRasterPage);
' Detect an area around a point in an image based upon a base pixel and threshold.

' Top left corner of image
Dim igPoint As New ImGearPoint(0, 0)
'Get the Pixel currently there.
Dim igPixel As ImGearPixel = igRasterPage.DIB.GetPixelCopy(0, 0)
' Detection class, threshold is difference in pixel channel values from specified pixel.
Dim igPixelCheckerThreshold As New ImGearPixelCheckerThreshold(igPixel, 100)
' Detect the region around target point within the threshold.
ImGearEffects.DetectArea(igRasterPage, igPoint, igPixelCheckerThreshold)

' Invert the contrast of the selected region to visible show the detected region.
ImGearRasterProcessing.InvertContrast(igRasterPage)
See Also

Reference

ImGearRasterProcessing Class
ImGearRasterProcessing Members
Overload List
ImGearRasterPage Class

Is this page helpful?
Yes No
Thanks for your feedback.