2

My first question on stackoverflow, so my apologies if I'm missing something.

I read in a reply in another J2ME transparency question from 2009 here at stackoverflow that "You should note that alpha is sometimes ignored on some implementations and sometimes quantized to ugly levels (Some motorola phones snap alpha values to the nearest 2-bit value)."

I am currently experimenting with transparency in J2ME, testing on rather new devices (at least in the J2ME world).

They all return 256 when I call Display.numAlphaLevels();

Yet, I only count max 8 actual levels (and mostly only 5 I can tell apart) when I set an image to slowly fade in. And it seems it is, as the above quote states, the nearest 2-bit value: 1% visible at level 2-3 3% visible at level 4-7 6% visible at level 8-16 12% visible at level 16-31 25% visible at level 32-63 50% visible at level 64-127 100% visible at level 128-255

Tested on Sony Ericsson Aino, Vivaz, and a Nokia N8, with both an 8bit PNG and a 24bit PNG. I consider those devices to be some of the latest models that can run J2ME.

The above quote makes it sound like it's not all J2ME enabled phones that behaves like this though. And that's why I ask my question:

Can anyone confirm that this is just how alphalevels are with J2ME enabled phones? If not, then how is it set up on other phones, and which phones are they? Do you know of any J2ME enabled phone that actually have all the 256 levels? Or one that can give e.g. 75% visibility?

Thanks

4

1 回答 1

0

好吧,不太确定我做错了什么,但显然是我的测试代码中的某些东西给了我这些错误的结果,恰好与另一位 JavaME 开发人员的引用相匹配,这使得结果看起来很可能。

自从我发布了这个问题后,alphalevel 突然出现了我希望它们出现的样子:漂亮而流畅。不确定我在代码中做了什么更改,目前太忙/懒得测试。

所以这个可以关闭。

于 2012-10-20T04:32:43.540 回答