This class contains methods and properties used by Bitmap to apply color adjustment.
Namespace:
Aurigma.GraphicsMill
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public Class ColorAdjustmentProvider _ Inherits LockableObject
public class ColorAdjustmentProvider : LockableObject
This class enables you to apply tone and color correction algorithms on the bitmap without creating appropriate transform object (contained in Aurigma.GraphicsMill.Transforms namespace). Therefore you can write only single line of code to make a tone correction. For example, instead of this code:
'... bitmap instantiation is omitted for brevity Dim hsl As New Aurigma.GraphicsMill.Transforms.AdjustHsl hsl.Hue = 0.1F hsl.Saturation = -0.2F hsl.Lightness = 0.1F hsl.ApplyTransform(bitmap)
//... bitmap instantiation is omitted for brevity Aurigma.GraphicsMill.Transforms.AdjustHsl hsl = new Aurigma.GraphicsMill.Transforms.AdjustHsl(); hsl.Hue = 0.1F; hsl.Saturation = -0.2F; hsl.Lightness = 0.1F; hsl.ApplyTransform(bitmap);
you can just use this code:
bitmap.ColorAdjustment.AdjustHsl(0.1F, -0.2F, 0.1F)
bitmap.ColorAdjustment.AdjustHsl(0.1F, -0.2F, 0.1F);
The only drawback of this short syntax is that you can run transforms and effects through this class only in synchronous mode. If you need to use asynchronous mode, you should create transform class instances and set up the asynchronous mode settings for them.
Another difference of using of this class instead of transform objects is event handling. Unlike transform objects, you should assign event handlers directly to the Bitmap class.