Hi Ronald
If you look at the code inside Proc.WhiteBalance_WhiteAt, you will see it is calling:
var
wavg: array [0..2] of double;
c: Integer;
coef: array [0..2] of double;
min, max: array [0..2] of integer;
begin
IEGetMinMax(bitmap, min, max);
wavg[0] := imax(1, bitmap.Pixels_ie24RGB[white_x, white_y].b);
wavg[1] := imax(1, bitmap.Pixels_ie24RGB[white_x, white_y].g);
wavg[2] := imax(1, bitmap.Pixels_ie24RGB[white_x, white_y].r);
for c := 0 to 2 do
coef[c] := max[c]/wavg[c];
IEApplyCoefficients(bitmap, coef, fOnProgress, Sender);
end;
You could implement this with a selection by iterating through all the pixels within the selection rect and setting wavg to an average of all the values.
Nigel
Xequte Software
www.xequte.com
nigel@xequte.com