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 Transparency not reported in loaded PSD file

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 - Dec 28 2013 : 06:36:31
I have observed that in the latest version of ImageEn when we load a .PSD file the control does not return the transparency of the layers. Why?

Here is the code that I am using for checking transparency:

LayerTransparency := Child.ImageEnView1.Layers[Child.ImageEnView1.LayersCurrent].Transparency;


This always returns 255.

How to solve this?

This feature/property works extremely well in the older version of ImageEN!


TIA



Yogi Yang
4   L A T E S T    R E P L I E S    (Newest First)
yogiyang Posted - Dec 31 2013 : 00:21:24
Thanks for the inputs.

I am waiting for Fabrizio or Nigel to give more detailed information and the reasons for doing this as this change is breaking my olde code completely.

And time is running out for a rewrite at this stage.

I am attaching a sample PSD file for checking.

This file has three layers and each layer's Opacity is set differently.

I have also applied layer mask to one Layer and have also saved an Alpha channel.

In spite of all these I always get Transparency as 255 so from where does ImageEn read transparency value and what are its actual use?

Download Attachment: 20141161623_YogiTest02.zip

Yogi Yang
w2m Posted - Dec 30 2013 : 07:53:14
From the help file:

TIELayer.Transparency

Declaration
property Transparency: integer;

Description
Set the overall transparency of the layer in the range from 0 (fully transparent) to 255 (totally opaque). Use Opacity instead of Transparency when the image has an alpha channel.

Transparency: integer; // 255=opaque, 0=transparent

TIELayer.Opacity

Declaration
property Opacity: double;

Description
Set the overall opacity of the layer in the range from 0 (fully transparent) to 1.0 (totally opaque). Use Opacity instead of Transparency when the image has an alpha channel.

I have no idea why Fabrizio says to use Opacity instead of Transparency when the image has an alpha channel.

Maybe Nigel or Fabrizio can explain in more detail.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
yogiyang Posted - Dec 30 2013 : 04:39:23
@William,

Thanks for your help.

But then if I use the Opacity property I get the opacity value as Double.

This same Transparency works in the older version (where Opacity property does not exist) as it should.

It seems the transition from 3.x to 5.x is quite a radical one!




Yogi Yang
w2m Posted - Dec 29 2013 : 09:00:53
I tested this problem with images you sent me.

The transparency in the images is based on the image transparency and not on the layer transparency. When you select a layer that appears transparent, 255 is returned because the layers transparency is 255 but the images transparency is 0. I can successfully set and get a layers transparency in a demo I will be sending you.

As best as I can determine there is nothing wrong with the code that gets or sets a layers transparency and the correct values are reported.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html