Layer Zero: Base Image
Layer One: FreeHandPolyline (Closed)
Layer Two: FreeHandPolyline (closed)
ImageEnView1.SelectionBase:= iesbBitmap;
ImageEnView1.SelectionMaskDepth:= 8; // see feathering
Walk Layers and locate the two FreeHandPolyline Layers (l1 and l2 are their LayerID's) and record the Polyline points, then make Select (SelectArrayX) from Polyline and CastColorChange.
if ( (l1 > -1) and (l2 > -1) ) then begin
// Select AND Cast WORKS AS INTENDED
ImageEnView1.LayersCurrent:= l1;
ImageEnView1.Deselect();
// Build Select Points From PolyLine
for i:= 0 to Length(SelectArray1)-1 do begin
ImageEnView1.AddSelPoint(SelectArray1[i].X, SelectArray1[i].Y);
end; // for
ImageEnView1.EndSelect();
// With Mask or Without - same results
TIEPolylineLayer(ImageEnView1.CurrentLayer).IsMask:= True;
// Focus Base Image
ImageEnView1.LayersCurrent:= 0;
ImageEnView1.Proc.CastColorRange(iMinColor, iMaxColor, FloodColour);
ImageEnView1.Update();
// Select AND Cast FAILS TO STAY WITHIN THE SELECT AREA - CHANGES THE WHOLE IMAGE
ImageEnView1.LayersCurrent:= l2;
ImageEnView1.Deselect();
// Build Select Points From PolyLine
for i:= 0 to Length(SelectArray2)-1 do begin
ImageEnView1.AddSelPoint(SelectArray2[i].X, SelectArray2[i].Y);
end; // for
ImageEnView1.EndSelect();
// With Mask or Without - same results
TIEPolylineLayer(ImageEnView1.CurrentLayer).IsMask:= True;
// Focus Base Image
ImageEnView1.LayersCurrent:= 0;
ImageEnView1.Proc.CastColorRange(iMinColor, iMaxColor, FloodColour);
ImageEnView1.Update();
// Remove Polyline Layers
ImageEnView1.LayersRemove(l2, False);
ImageEnView1.LayersRemove(l1, False);
// Focus Base Layer
ImageEnView1.LayersCurrent:= 0;
end;
Once Base Image has the first CastColorChange applied, the Base Image no longer responds correctly to the second CastColorChange process ???
Please advise how to accomplish - thanks in advance.
Andy