CGpHueSaturationLightness.SetParametesmethod
Syntax
FUNCTION SetParametes (BYVAL hueLevel AS INT_, BYVAL saturationLevel AS INT_, BYVAL lightnessLevel AS INT_) AS GpStatus
SetParameters — one description covers them all.Parameters
| Name | Description | |
|---|---|---|
uSize | Pointer to a UINT that specifies the size, in bytes, of a HueSaturationLightnessParams structure. | |
params | Pointer to a HueSaturationLightnessParams structure that specifies the parameters. | |
hueLevel | Integer in the range -180 through 180 that specifies the change in hue. A value of 0 specifies no change. Positive values specify counterclockwise rotation on the color wheel. Negative values specify clockwise rotation on the color wheel. | |
saturationLevel | Integer in the range -100 through 100 that specifies the change in saturation. A value of 0 specifies no change. Positive values specify increased saturation and negative values specify decreased saturation. | |
lightnessLevel | Integer in the range -100 through 100 that specifies the change in lightness. A value of 0 specifies no change. Positive values specify increased lightness and negative values specify decreased lightness. |
Return value
If the method succeeds, it returns StatusOk, which is an element of the GpStatus enumeration.
If the method fails, it returns one of the other elements of the GpStatus enumeration.
Description
Sets the current values of the parameters of this HueSaturationLightness object.
Example
' ======================================================================================== ' The HueSaturationLightness effecty enables you to change the hue, saturation, and lightness ' of a bitmap. To specify the magnitudes of the changes in hue, saturation, and lightness, ' pass a HueSaturationLightnessParams structure to the SettParameters function. ' ======================================================================================== SUB Example_BitmapHueSaturationLightnessEffect (BYVAL hdc AS HDC)
' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scaling factors using the DPI ratios graphics.ScaleTransformForDpi
' // Create a Bitmap object from a JPEG file. DIM bmp AS CGpBitmap = "climber.jpg" ' // Set the resolution of the image using the DPI ratios bmp.SetResolutionForDpi
' // Create a HueSaturationLightness effect DIM hueEffect AS CGpHueSaturationLightness ' // Set the parameters DIM hslParams AS HueSaturationLightnessParams hslParams.hueLevel = 45 ' Rotate hue slightly hslParams.saturationLevel = 30 ' Boost saturation hslParams.lightnessLevel = -10 ' Slightly darken hueEffect.SetParameters(@hslParams)
' // Apply effect to the whole image bmp.ApplyEffect(@hueEffect)
' // Draw the image graphics.DrawImage(@bmp, 10, 10)
END SUB ' ========================================================================================
Reference
- Include file
CGpEffect.inc - Documented in Graphics/GdiPlus Classes/CGpEffect Class.md
- Topic: CGpEffect Class