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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to copy vectors between layers in ImageEn?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jccruz

Brazil
30 Posts

Posted - Sep 08 2019 :  20:00:35  Show Profile  Reply
Hello everyone!

On my system, I apply some filters and lastly I call adaptiveThreshold. From the image with all filters applied, the user draws vectors to identify the objects in the image.

However, I do not want the user to identify the objects in the filtered image, but in the original image.

So when the user draws a vector, such as a line in the original image, it needs to be cloned at exactly the same position in the filtered image that will be hidden.

One solution I thought was to use a layer, where layer 0 would be the original image and layer 1 would be the image with the filters applied.

Doubts:

1) How do I clone the original image into a new layer that has exactly the same dimensions and position as the original image?

2) How do I apply filters only to layer 1 always leaving layer 0 as visible?

3) How do I get vectors drawn on layer 0 to be copied (cloned) to layer 1 in the same position?

Thanks in advance for the help!

JCC

xequte

38176 Posts

Posted - Sep 10 2019 :  01:13:41  Show Profile  Reply
Hi

That should be largely straight forward.

1. You can use:

// Clone layer 0
iLayer := ImageEnView2.LayersAdd( ImageEnView1.Layers[ 0 ].Kind );
ImageEnView2.Layers[ iLayer ].Assign( ImageEnView1.Layers[ 0 ] );

2. ImageEnProc methods are applied to the bitmap of the active layer. If LayersCurrent = 1, then the filter will apply only to layer 1 bitmap

3. Assuming you don't want it is real time, you can do

// Assign layers from one ImageEnView to another (but not background image)
// Note: ImageEnView2.assign( ImageEnView1 ) will assign all content including layers
for I := 1 to ImageEnView1.LayersCount - 1 do
begin
  // Append layer of same time
  iLayer := ImageEnView2.LayersAdd( ImageEnView1.Layers[ i ].Kind );

  // Assign all properties
  ImageEnView2.Layers[ iLayer ].Assign( ImageEnView1.Layers[ i ] );
end;
ImageEnView2.Update();


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: