ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Proc.CastColorRange() Flood issue

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
andyhill Posted - Sep 09 2022 : 02:39:14
When I load ImageX(Layer 0) and then build a Select in code followed by calling

ImageEnView1.Proc.CastColorRange(iMinColor, iMaxColor, FloodColor);

First time call the Flood Fill Color Cast leaks outside of the select area.

Reloading ImageX again and Building the Select in code a second time, then the Flood Fill Color Cast stays within the select area - it is as if something is not fully initialized.

Please advise how to resolve - thanks.

// COLOUR CAST
    if Length(SelectArray1) > 0 then begin
      ImageEnView1.LayersCurrent:= 0;
      ImageEnView1.Deselect();
      ImageEnView1.Update();
      for i:= 0 to Length(SelectArray1)-1 do begin
        ImageEnView1.AddSelPoint(SelectArray1[i].X, SelectArray1[i].Y);
      end; // for
      ImageEnView1.EndSelect();
      ImageEnView1.Update();
      ImageEnView1.Proc.CastColorRange(iMinColor, iMaxColor, FloodColour);      
      ImageEnView1.Update();
    end;


Andy
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 13 2022 : 17:13:59
Hi Andy

Yes, it's not required, but there should be no issue in adding one.

"while ImageEnView1.IsUpdating do..." should not have any effect because the call to CastColorRange() is synchronous (assuming there is not code elsewhere that is triggering an update).

Nigel
Xequte Software
www.imageen.com
andyhill Posted - Sep 13 2022 : 01:09:18
Finally, after untold trial and error testing - I found the culprit.

Building Selects In Code DOES NOT REQUIRE A CLOSING POINT (this is automatically added using double precision maths and cannot be represented in code by integers) ???

Work around - do not add closing point when building selects in code.

Also, for what it is worth I added (which may not be required):-

ImageEnView1.Proc.CastColorRange(iMinColor, iMaxColor, FloodColour);
while ImageEnView1.IsUpdating do begin
// wait
end;



Andy
xequte Posted - Sep 12 2022 : 22:16:37
You must call EndSelect() after adding a batch of selection points:

https://www.imageen.com/help/TImageEnView.EndSelect.html

Nigel
Xequte Software
www.imageen.com
xequte Posted - Sep 09 2022 : 16:25:41
Hi Andy

Can you give me the full set of code to reproduce this?

Nigel
Xequte Software
www.imageen.com
andyhill Posted - Sep 09 2022 : 16:03:34
Further investigation shows (ALL POINTS ARE IDENTICAL):

Code Loads Image on Layer0(OK)
USER MOUSE DRAWN Polygon on Layer1(OK)
Code Gleans Polygon Points from Layer1(OK)
Code Removes Layer1(OK)
Code Builds Select (from points gleaned) on Layer0(OK)
Code CastColor BLEEDS (it has some sort of invisible point included [by mouse ?] in the CastColor execution even though none present in points)

ALL CODE
Code Loads Image on Layer0(OK)
Code Draws Polygon on Layer1(OK)
Code Gleans Polygon Points from Layer1(OK)
Code Removes Layer1(OK)
Code Builds Select (from points gleaned) on Layer0(OK)
Code CastColor works perfectly


Andy