RedEyeCorrection class

An Effect that corrects red eyes in the rectangles of a picture that a program names.

The effect works only inside the rectangles of its RedEyeCorrectionParams. The program, or the user, finds the eyes; the effect fixes their colour. The class mirrors the GDI+ RedEyeCorrection class and inherits the members of Effect.

Creating

Syntax: fx = RedEyeCorrection( )

Syntax: fx = RedEyeCorrection( params )

Each form is also available as New RedEyeCorrection( … ) with the same arguments.

params
required A RedEyeCorrectionParams: the number of areas and the memory that holds their rectangles.

A constructor that fails creates an unusable object whose LastResult tells why. The effect created without arguments has no areas, and Bitmap.ApplyEffect refuses to apply it: the call returns 2 (InvalidParameter).

Parameters

Syntax: fx.Parameters [ = params ]

Syntax: params = fx.Parameters( size )

Gets or sets the RedEyeCorrectionParams. The setter creates the GDI+ effect again and sets the parameters on the new one, with the size LenB(Of RedEyeCorrectionParams) plus the size of the rectangles.

The areas are described by a structure whose methods allocate and fill the rectangles; the page of RedEyeCorrectionParams shows them.

Dim user As GdiPlusUser = GdiPlusUser()

Dim fx As RedEyeCorrection = RedEyeCorrection()
Debug.Print fx.LastResult

Dim bmp As Bitmap = Bitmap(10!, 10!)
Graphics(bmp).Clear(Color(255, 220, 20, 20))
Debug.Print bmp.ApplyEffect(fx, GpRect(0, 0, 10, 10))
' Output:
' 0
' 2

See Also