Alpha of ImageData not working for RAP [message #1404771] |
Tue, 05 August 2014 15:35 |
|
Alpha transparency for SWT ImageData does not appear to be supported by RAP.
In SWT I often used this to create a series of images with different alpha values in order to animate a fade-out or fade-in effect, but this has no effect in RAP (or Tabris in fact), and the image remains at 100% alpha.
My code is something like this:
Image alphaImage = ...;
ImageData alphaImageData = alphaImage.getImageData();
alphaImageData.alpha = desiredAlpha; // 0-255
Image adjustedAlphaImage = new Image(display, alphaImageData);
myLabel.setImage(adjustedAlphaImage);
Is this a known limitation of RAP, or is it a bug?
Thanks, John
---
Just because you can doesn't mean you should
|
|
|
|
Re: Alpha of ImageData not working for RAP [message #1404950 is a reply to message #1404931] |
Wed, 06 August 2014 08:08 |
|
That pointed me in the right direction...
PNG images are not saved with the alpha value for the overall image... only the alphaBytes[] array. Therefore, I've changed my logic to set the alphaBytes[] and don't touch alpha at all, and this works perfectly in RAP.
Thanks Ivan!
John
---
Just because you can doesn't mean you should
|
|
|
Powered by
FUDForum. Page generated in 0.02075 seconds