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
 Inconsistent Layerbackground 0 behavior.
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

zerob

151 Posts

Posted - Sep 09 2024 :  14:18:35  Show Profile  Reply
If i open an empty TImageEnView, there is a white background 616 x 385.
When i do a LayersClear and LayersAdd to load a backgroundless PSD, ImageEnView merges all PSD Layers and adds it with a gray background layer with the same 616 x 385 size (but not white anymore).

When i do a IO.LoadFromFilePSD or a LayersImport, there is no background layer anymore (as these PSDs don't contain this).
When i now again do a
LayersClear;
LayersAdd(...psd);

Then it loads the PSD merged into a single layer and leaves the old bottom most layer from previous PSD layersImport, as it considers it a background as it was the Layer nr 0.

So it first changes color to gray and then it leaves old layer 0.

Why is there a background layer forced at all, when you handle Transparency and have Chessboard views? Is this for convinience with algorythms and something from the early years? And there needs to be a complete wipe when calling things like LayersClear, so no old layers stay, including their graphics, just because they where the nr 0.

xequte

38530 Posts

Posted - Sep 09 2024 :  15:31:31  Show Profile  Reply
Hi

You can use LayersClear( True ) to also wipe the background layer.

http://www.imageen.com/help/TImageEnView.LayersClear.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

zerob

151 Posts

Posted - Sep 09 2024 :  16:09:27  Show Profile  Reply
Hmm well, i overlooked that parameter. But it still isn't working as expected.
1. The app starts with a white background (which is default) and LayersClear changes it to grey, like the color of the area outside of the background.
2. The Layer name, size, position and so on stays the same even after a "LayersClear(True)", only the color changes to grey. I expected it to reset everything to default and not stay like a previous PSD or the user set it.

Is this Background Layer0 mandatory or can it be disabled somehow if i plan to work with alpha channels and just the Photoshop like Chessboard background and have no need for a white background Layer0 ? I guess it is entangled in to deep in different functions to disable.
Go to Top of Page

xequte

38530 Posts

Posted - Sep 09 2024 :  17:51:37  Show Profile  Reply
Sorry, I'm trying to understand if gray is just background color.

Can you set the following properties and send me a screenshot of what you are referring to:
https://www.imageen.com/help/TIEView.BackgroundStyle.html
https://www.imageen.com/help/TImageEnView.BackgroundOuter.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

xequte

38530 Posts

Posted - Sep 09 2024 :  21:29:40  Show Profile  Reply
Hi

I checked the code, and if LayersClear(True) is called then all the layer properties are reset (position, etc). However the image is cleared (filled with the background color) rather than blanked, so you might want to call:

ImageEnView1.ClearAll();

Which also resets layer 0 to a null size.


There will always be a Layer 0 (background layer) even if it is not visible (e.g. has a null size, or is fully transparent), because it is used as the basis for positioning of all layers.

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