Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » How must Alpha be managed ??
Re: How must Alpha be managed ?? [message #38550 is a reply to message #38508] |
Sun, 23 December 2012 10:03   |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
Didier wrote on Thu, 20 December 2012 18:16 | Hi all,
I am currently trying to draw buttons that are transparent but they have special shapes.
For rectangles: it is easy, all I have to do is draw a small img in iml designer, set the RGBA values for all points and then use this image to draw in the dest rectangle.
For other shapes (circles for ex), I try to use ImageDraw and Alpha() method and it works ...
Question:
In the iml designer: all points are set to : RGBA(46,46,46,51)
Using Image Draw, I draw a circle with Color(46,46,46) and apply GreyColor(51)
... expecting to get RGBA(46,46,46,51)
But the result is not the same at all !!
Which is the way to go ?? (the color obtained with src image gives me the result expected by client )
|
Actually, you are doing the right. In fact, ImageDraw uses R channel as alpha.
Anyway, I think the difference you can see MIGHT be because of alpha channel premultiply issue. E.g. RGBA(46, 46, 46, 51) can never be present in Image (it is invalid value). If you have applied 51 alpha to RGB(46, 46, 46), you should get something like RGBA(46, 46, 46, 9) if you read pixel from Image created from ImageDraw.
Mirek
|
|
|
 |
|
How must Alpha be managed ??
By: Didier on Fri, 21 December 2012 00:16
|
 |
|
Re: How must Alpha be managed ??
By: forlano on Fri, 21 December 2012 09:49
|
 |
|
Re: How must Alpha be managed ??
By: omari on Fri, 21 December 2012 10:31
|
 |
|
Re: How must Alpha be managed ??
By: Didier on Fri, 21 December 2012 14:47
|
 |
|
Re: How must Alpha be managed ??
By: Didier on Fri, 21 December 2012 16:24
|
 |
|
Re: How must Alpha be managed ??
By: omari on Fri, 21 December 2012 21:53
|
 |
|
Re: How must Alpha be managed ??
By: Didier on Fri, 21 December 2012 22:31
|
 |
|
Re: How must Alpha be managed ??
By: mirek on Sun, 23 December 2012 10:03
|
 |
|
Re: How must Alpha be managed ??
By: Didier on Sun, 23 December 2012 13:10
|
 |
|
Re: How must Alpha be managed ??
By: mirek on Sun, 23 December 2012 13:27
|
 |
|
Re: How must Alpha be managed ??
By: Didier on Sun, 23 December 2012 21:20
|
Goto Forum:
Current Time: Thu Aug 28 09:08:36 CEST 2025
Total time taken to generate the page: 0.06652 seconds
|