Author |
Topic  |
|
zerob
  
198 Posts |
Posted - Sep 09 2024 : 14:18:35
|
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
    
38944 Posts |
|
zerob
  
198 Posts |
Posted - Sep 09 2024 : 16:09:27
|
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. |
 |
|
xequte
    
38944 Posts |
|
xequte
    
38944 Posts |
Posted - Sep 09 2024 : 21:29:40
|
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
|
 |
|
|
Topic  |
|
|
|