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
 Layer Transparency not reported in loaded PSD file
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Dec 28 2013 :  06:36:31  Show Profile  Reply
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

w2m

USA
1990 Posts

Posted - Dec 29 2013 :  09:00:53  Show Profile  Reply
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
Go to Top of Page

yogiyang

India
727 Posts

Posted - Dec 30 2013 :  04:39:23  Show Profile  Reply
@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
Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 30 2013 :  07:53:14  Show Profile  Reply
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
Go to Top of Page

yogiyang

India
727 Posts

Posted - Dec 31 2013 :  00:21:24  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: