GdPicture.NET Reference Guide
SetSaturation Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : SetSaturation Method
GdPicture Image Identifier.
Saturation adjustment between -100 and 100.
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
Increasing Saturation of an image by 50%
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("input.png")
Dim SaturationValue As Integer = 50
oGdPictureImaging.SetSaturation(ImageID, SaturationValue)
oGdPictureImaging.SaveAsPNG(ImageID, "output.png")
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
Decreasing Saturation of an image by 30%
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("input.png")
Dim SaturationValue As Integer = -30
oGdPictureImaging.SetSaturation(ImageID, SaturationValue)
oGdPictureImaging.SaveAsPNG(ImageID, "output.png")
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
SetROI Method
ResetROI Method
SetBCSG Method