Accusoft.ImagXpress13.Net
AdjustRGB Method
Example 




The AdjustType enumeration value set. The AdjustType indicates whether the red, green, and blue parameters are specified in units or by percentage.
An integer value which represents the smount of adjustment to apply to the red color component.
An integer value which represents the amount of adjustment to apply to the green color component.
An integer value which represents the amount of adjustment to apply to the blue color component.
Adjusts the red, green, and blue components of the current image.
Syntax
'Declaration
 
Public Sub AdjustRGB( _
   ByVal adjustType As AdjustType, _
   ByVal red As Integer, _
   ByVal green As Integer, _
   ByVal blue As Integer _
) 
'Usage
 
Dim instance As Processor
Dim adjustType As AdjustType
Dim red As Integer
Dim green As Integer
Dim blue As Integer
 
instance.AdjustRGB(adjustType, red, green, blue)
public void AdjustRGB( 
   AdjustType adjustType,
   int red,
   int green,
   int blue
)
public: void AdjustRGB( 
   AdjustType adjustType,
   int red,
   int green,
   int blue
) 
public:
void AdjustRGB( 
   AdjustType adjustType,
   int red,
   int green,
   int blue
) 

Parameters

adjustType
The AdjustType enumeration value set. The AdjustType indicates whether the red, green, and blue parameters are specified in units or by percentage.
red
An integer value which represents the smount of adjustment to apply to the red color component.
green
An integer value which represents the amount of adjustment to apply to the green color component.
blue
An integer value which represents the amount of adjustment to apply to the blue color component.
Remarks

When adjustType = AsPercent (0), valid red, green, and blue values are between -100 and 100 (percent).

When adjustType = InUnits (1), valid RGB values are between -255 and 255 (units). Since pixel values must fall within the range 0-255, resulting pixel values less than 0 are set to 0 and resulting pixel values greater than 255 are set to 255.

Example

Sepia sample

The following example uses the AdjustRGB method and the ColorDepth method, to convert an image to Sepia.

private void ConvertToSepia(ImageX image)
{
	using (Processor processor1 = new Processor(imagXpress1, image))
    {
	    processor1.ColorDepth(8, PaletteType.Gray, DitherType.NoDither);
	    processor1.ColorDepth(24, PaletteType.Optimized, DitherType.NoDither);
	    processor1.AdjustRGB(AdjustType.InUnits, 40, 30, -10);
	    processor1.Brightness(-10);
	    processor1.Image = null;
	}
}
See Also

Reference

Processor Class
Processor Members

 

 


©2017. Accusoft Corporation. All Rights Reserved.

Send Feedback