On 25 March 2011 04:54, Bill van Melle <[email protected]> wrote:
> I have an app in which I sometimes want to grey out images that are not the > current images "of interest". So I'm using a GrayscaleDecorator, which > works fine for solid images. But if the images have transparent parts, I > want the decorator to leave them unaffected, so that the background shows > through, rather than turning those pixels black. Is there any way to do > that? Is this a bug in the decorator? Pivot comes with a number of Decorator implementations. If there isn't one that does exactly you need, I wouldn't describe that as a bug. http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/effects/Decorator.html You are free to write your own implementations to meet your needs, so I would recommend familiarizing yourself with the source of the various provided Decorators, and then searching the net to find examples of how to perform the one or more transformations/operations you might need. For example, a quick search found this post demonstrating 3 different grayscale conversion techniques and some comments discussing transparency. http://blog.codebeach.com/2008/03/convert-color-image-to-gray-scale-image.html Chris
