Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 34
Registered: ‎03-14-2010
My Device: N/A
My Carrier: Fledge
Accepted Solution

Transparency and color accuracy

Hello,

 

I've created a png image with only 1 color: white, but with varying degrees of transparency.  

 

My idea is to overlay this png on top of any solid color and create a glossy UI effect, regardless of what the background color is.

 

However, when I implement it, I only see about 5 different shades of white, when theoretically there should be 255 different shades.  Needless to say, it looks terrible.

 

Do you have any suggestions on how to make this work better?  Could I manually draw the pixels using Graphics.drawARGB for a better effect, or is it a limitation of the simulator or blackberry device?

 

If you have any suggestions on how to create the desired effect, I would greatly appreciate them.

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Transparency and color accuracy

BlackBerrys have 16bit displays. When you make your image see in whatever program you have if you can save/view it with 16bit color to see how it will actually look.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Contributor
Posts: 34
Registered: ‎03-14-2010
My Device: N/A
My Carrier: Fledge

Re: Transparency and color accuracy

Thank you for your response!  

 

How does transparency factor into the 16 bit color model?  Please excuse my ignorance on the issue.

Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Transparency and color accuracy

I'm pretty sure transparency is 8bit (0-255) but the transparent color is mixed with the underlying color and the result is 16bit color. I would do some tests to figure out the best combo of what you want. So make some normal, 32bit images and then save them as 16bit images to see how the scaled colors work out.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.