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?

Example -- fill in your favorite test image that uses transparency:

<Window
  xmlns:effects="org.apache.pivot.wtk.effects"
  xmlns="org.apache.pivot.wtk">
  <BoxPane styles="{backgroundColor:'white'}">
    <ImageView image="@test.png" styles="{backgroundColor:null}" />
    <ImageView image="@test.png" styles="{backgroundColor:null}">
      <decorators>
        <effects:GrayscaleDecorator />
      </decorators>
    </ImageView>
  </BoxPane>
</Window>

In this particular example, I could have set the background of the ImageView
to be white instead of null and it would look fine, but in general the
background won't be white, and I don't want the decorator to modify those
background pixels.

Reply via email to