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
 Layer Merge is not working as documented

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
yogiyang Posted - Feb 26 2020 : 01:16:26
Hello,

I am using following code:

var
  SelLayers: array of Integer;
  I: Integer;


for I := ieViewMain.LayersCount - 1 downto 1 do
  begin
    if (ieViewMain.Layers[I].Selected) then
    begin
      SetLength(SelLayers, Length(SelLayers) + 1);
      SelLayers[Length(SelLayers) - 1] := I;
    end;
  end;

  ieViewMain.LayersMerge(SelLayers);


The output is not consistent. It tends to vary from file to file.

At times Merged Layers just vanishes.

I have attached a sample file for testing.

As I am not able to upload this file as attachment (getting Internal Server Error 500) I am uploaded it to Mediafile.

The download link: https://www.mediafire.com/file/9ahqspavskbdjds/SampleIn100dpi.psd/file

TIA




Yogi Yang
8   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Mar 08 2020 : 16:45:23
Hi Yogi

I cannot reproduce that using the image you sent me. Can you give it to me as code (i.e. code that selects the layers and merges them, reproducing the error).

Nigel
Xequte Software
www.imageen.com
yogiyang Posted - Mar 06 2020 : 06:49:13
Hello,

I am still facing problems while merging Layers.

Here are a few screen shots:



The number of Selected Layers are 12.

The code is:

if ieViewMain.LayersSelCount(False) > 0 then
  ieViewMain.LayersMerge();



Why must this be happening?

TIA


Yogi Yang
xequte Posted - Mar 02 2020 : 14:12:56
Hi Yogi

The test above works the same whether I do it with code, or selecting by hand.


Nigel
Xequte Software
www.imageen.com
yogiyang Posted - Mar 02 2020 : 00:10:23
Hello,

Merging Layers with code would work but not when the use has selected a few layers interactively and we call: LayersMerge().

In my case some the user may have also linked/grouped some of the layers.

TIA


Yogi Yang
xequte Posted - Mar 01 2020 : 23:10:17
Hi Yogi

Actually it looks to be working as expected. If I call:

  ImageEnView1.IO.LoadfromFilePSD( 'D:\SampleIn100dpi.psd');
  ImageEnView1.LayersDeselectAll;
  ImageEnView1.Layers[2].Selected := True;
  ImageEnView1.Layers[4].Selected := True;
  ImageEnView1.Layers[6].Selected := True;
  ImageEnView1.Layers[17].Selected := True;
  ImageEnView1.Layers[22].Selected := True;
  ImageEnView1.LayersMerge()


It merges all the layers correctly. Because you have selected non-contiguous layers, the merged layers move behind the black boxes in the image. You need to move the black box layers behind the layer (or include them in the selection).

In other words, if you select layer 2 and 4 select and merge them, they will become layer 2. Therefore the layer 4 content is now behind the layer 3 content.

Nigel
Xequte Software
www.imageen.com
yogiyang Posted - Feb 27 2020 : 07:05:13
Hello,
 
Also, you can just use:

// Merge all selected layers
ImageEnView1.LayersMerge();


Using this also gives undesirable results. All the layers just vanish except the lowest Layer. For example if we have selected 2, 4, 16, 17, 22 then if we use just LayersMerge() all the layers vanish and the lowest on that is 2 remains.

How to solve this?

TIA


Yogi Yang
xequte Posted - Feb 26 2020 : 18:16:52
Hi Yogi

Do not use a reverse for loop. It should work correctly if you count up. I will improve the documentation.

Also, you can just use:

// Merge all selected layers
ImageEnView1.LayersMerge();


Nigel
Xequte Software
www.imageen.com
yogiyang Posted - Feb 26 2020 : 02:03:23
Hello,

For testing select all the Layers (Including Masks) except Background (Layer 0) and the try to merge them.

Then reload the file and select a few layers randomly. Here when you select a layer take care to also select any layers which are directly under the selected layer and then try to merge them.

TIA


Yogi Yang