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
 How to calculate Opacity properly

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 - Jan 04 2014 : 08:28:58
Hello,

I am attaching an image with this post which contains a few layers whose Opacity is set at 99 but ImageEn reports 0.988235294117647 (Layer 1 & 4)

In the same way if the Opacity is set at 98 ImageEn reports 0.980392156862745 (Layer 6)

Again Opacity 91 is reported as 0.909803921568627 (Layer 3)

Now trying to multiply above value by 100 would give me 98 in case of Layer 1, 4 & 9.

How to get the exact value of 99 and 99?

TIA

Yogi Yang

Download Attachment: 20141482733_SampleImage_008.zip
2   L A T E S T    R E P L I E S    (Newest First)
yogiyang Posted - Jan 04 2014 : 23:14:10
William,

Thanks for the suggestion.

I think I have found a solution to this problem.

Round(Layers[I].Opacity * 100)


If you feel this is wrong please do correct me.

Regards,


Yogi Yang
w2m Posted - Jan 04 2014 : 09:03:15
var
iLayerOpacity: double;
iLayerOpacityString: string;
iLayerOpacity := ImageEnView.Layers[i].Opacity * 100;
iLayerOpacityString := FormatFloat('0',iLayerOpacity); //show 98
... or ...
iLayerOpacityString := FormatFloat('###',iLayerOpacity); //show 98

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