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
 Transapency question
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

pierrotsc

USA
499 Posts

Posted - Apr 01 2016 :  14:41:28  Show Profile  Reply
When I draw a box, is there a way to modify the transparency of either the borders or the inside but not both at the same time?
Right now, if I have a brush that is bssolid and I change the transparency of the brush, it also affects the pen transparency of the box.
I could be doing something wrong.
So if it is possible to modify only one of the two, then I can look depper in my code.
Thanks.
Pierre

w2m

USA
1990 Posts

Posted - Apr 01 2016 :  14:53:25  Show Profile  Reply
I do not think setting the pen and brush transparency separately is supported. Transparency set both the pen and brush transparency so to just adjust the pen transparency just set the brush style to bsClear:
ObjBrushStyle[ihobj] := bsClear;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
499 Posts

Posted - Apr 01 2016 :  15:01:02  Show Profile  Reply
the issue is that when I set the brush type to bssolid and I dither the transparency of the brush, it works great but it also change the transparency of the pen. the pen does not stay a solid red. Maybe in am coding it wrong.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 01 2016 :  15:02:16  Show Profile  Reply
I do not think setting the pen and brush transparency separately is supported. When you change the transparency the entire object's transparency is changed.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
499 Posts

Posted - Apr 01 2016 :  19:01:06  Show Profile  Reply
yes, i think you are correct. i can change the style of the pen and make it clear but i cannot change the brightness of the pen by itself. that is fine. thanks for the input.
Go to Top of Page

xequte

39053 Posts

Posted - Apr 03 2016 :  04:32:47  Show Profile  Reply
Hi Pierre

Are you using a TImageEnVect, or drawing directly to a TIEBitmap? When drawing to a TIEBitmap, you should draw to the canvas, and simultaneously to the alpha channel canvas. Use CanvasCurrentAlpha to specify the transparency level:

http://www.imageen.com/help/TIEBitmap.CanvasCurrentAlpha.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 03 2016 :  09:05:30  Show Profile  Reply
I am pretty sure he is using TImageEnVect.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
499 Posts

Posted - Apr 04 2016 :  09:55:33  Show Profile  Reply
Yes, I am using a timgeenvect. The idea of using a tiebitmap is very clever but I would not know on how to code that. I am dragging the cursor to draw a box.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 04 2016 :  10:00:42  Show Profile  Reply
ImageEnVect1.IEBitmap.AlphaChannel.CanvasCurrentAlpha is only for drawing to the IEBitmap canvas not for use with objects. It is not possible to set the transparency of the objects pen and the brush separately. If you set the transparency of the object it will effect the entire object as you have already established.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
499 Posts

Posted - Apr 04 2016 :  10:29:38  Show Profile  Reply
Thanks Bill. I get it now...I need to use objects..I will stick with the pen style to hide/show the border then.
Go to Top of Page

xequte

39053 Posts

Posted - Apr 04 2016 :  22:00:39  Show Profile  Reply
Thanks Bill, I missed that.

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