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





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

Parameters

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

Return Value

A member of the GdPictureStatus enumeration.
Remarks
This method is used in the "Image Processing" Demo.
Example
Change image brightness using random value and saves result into a PNG file.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("input.png");
 
    // Change image brightness using random value. Allowed values are from -100 to +100.
    Random random = new Random();
    int brightness = random.Next(-100, 100);
    gdpictureImaging.SetBrightness(imageID, brightness);
 
    gdpictureImaging.SaveAsPNG(imageID, "output.png");
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also