GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / SetSaturation Method
GdPicture image identifier.
Saturation adjustment between -100 and 100.
Example





In This Topic
SetSaturation Method (GdPictureImaging)
In This Topic
Adjust the Saturation in a GdPicture image or in an area of a GdPicture image defined by SetROI() method.
Syntax
'Declaration
 
Public Function SetSaturation( _
   ByVal ImageID As Integer, _
   ByVal Saturation As Integer _
) As GdPictureStatus
public GdPictureStatus SetSaturation( 
   int ImageID,
   int Saturation
)
public function SetSaturation( 
    ImageID: Integer;
    Saturation: Integer
): GdPictureStatus; 
public function SetSaturation( 
   ImageID : int,
   Saturation : int
) : GdPictureStatus;
public: GdPictureStatus SetSaturation( 
   int ImageID,
   int Saturation
) 
public:
GdPictureStatus SetSaturation( 
   int ImageID,
   int Saturation
) 

Parameters

ImageID
GdPicture image identifier.
Saturation
Saturation adjustment between -100 and 100.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
This filter is not inteneded to alter gray leveled bitmaps, and they will stay the same.

This method is used in the "Image Processing" Demo.

Example
Adjusting the saturation on your image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // LoadInMemory parameter is set to true in order to be able to update the input file.
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg", true);
 
    // Set the saturation intensity.
    int saturation = 100;
 
    // Apply the saturation to your image.
    gdpictureImaging.SetSaturation(imageID, saturation);
    gdpictureImaging.SaveAsJPEG(imageID, "image.jpg");
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also