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
 How to copy vectors between layers in ImageEn?

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
jccruz Posted - Sep 08 2019 : 20:00:35
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
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 10 2019 : 01:13:41
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