B4J Question TextField Background Color

Toley

Active Member
Licensed User
Longtime User
I have a curious issue with TextField Background colors. In this simple example I simply place 3 text fields each with the following parameters. 1st one is R255, G0, B0, A50%, 2nd R0, G255, B0 A50% and the other one is the same with blue. And this what I get as resulting colors.

TextField.png

I also provide the sample test program.
 

Attachments

  • TextField.zip
    1.8 KB · Views: 413

stevel05

Expert
Licensed User
Longtime User
This is what I get from your code

upload_2017-2-25_1-1-33.png
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
What version of B4j and Jdk are you using? My results are with B4j 4.70 and JDK 1.8.0_71

And what hardware?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Have you tried restarting B4j and or the PC? (I sound like a support technician :) )
 
Upvote 0

Toley

Active Member
Licensed User
Longtime User
I have reboot and I always got the same result. I can't believe it depends on my PC it's an almost new machine i7 @ 3.40 GHz with 16GB of RAM.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Just asking the easy questions first. This could be tricky. Have you noticed anything else unusual with the colours on other applications?
 
Upvote 0

Toley

Active Member
Licensed User
Longtime User
Don't worry this PC is a beast. it's a gamer machine it can play all the latest games without any color problem. I've try the program on my old laptop and it's OK so there is a compatibility issue somewhere. I will investigate that tomorrow.
 
Upvote 0

Toley

Active Member
Licensed User
Longtime User
The problem is in the Alpha parameter and it can also be seen on the Designer. As soon as the Alpha is not 100% (I've try with 99%) the text field disappear. This is not exclusive to Text Field, it apply also to any views that is color drawable like buttons and probably others.

P.S. For an unknown reason I cannot upload screenshots on this reply.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
A quick search on google shows that there have been quite a few issues with Java on certain graphic cards. It is worth looking to see if yours is one of them. And of course make sure you have the latest drivers installed
 
Upvote 0

Toley

Active Member
Licensed User
Longtime User
Hi Erel thanks for taking care of this problem. I cannot say why it woks on some PC and not on some others, but I can assure you this problem is real. I was able to reproduce it on a Toshiba laptop also.

Yes it can be seen the WYSIWYG Designer too. Look at these 2 sceenshots one with alpha at 100% (OK) and one with alpha at 99% (the text field disappear).

Alpha100.png Alpha99.png
 
Upvote 0

Toley

Active Member
Licensed User
Longtime User
Thanks for that info. When I add
B4X:
#VirtualMachineArgs: -Dprism.verbose=true

The log show that (I have apply color to the lines that appear red in the log)

Prism pipeline init order: d3d sw
Using native-based Pisces rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.d3d.D3DPipeline
Loading D3D native library ...
succeeded.
D3DPipelineManager: Created D3D9Ex device
Direct3D initialization succeeded
(X) Got class = class com.sun.prism.d3d.D3DPipeline
Initialized prism pipeline: com.sun.prism.d3d.D3DPipeline
Maximum supported texture size: 16384
Maximum texture size clamped to 4096

OS Information:
Windows version 10.0 build 14393
D3D Driver Information:
AMD Radeon (TM) R9 200 Series
\\.\DISPLAY1
Driver aticfx64.dll, version 21.19.413.0
Pixel Shader version 3.0
Device : ven_1002, dev_6811, subsys_86A41043
Max Multisamples supported: 4
vsync: true vpipe: true
Waiting for debugger to connect...
Program started.
Loading Prism common native library ...
succeeded.

Adding -Dprism.order=sw do not change anything but with -Dprism.order=j2d I have this result
j2d_result.png

This is different but still not what it is supposed to be. And the log show this:
WARNING: The prism-j2d pipeline should not be used as the software
fallback pipeline. It is no longer tested nor intended to be used for
on-screen rendering. Please use the prism-sw pipeline instead by setting
the "prism.order" system property to "sw" rather than "j2d".

Waiting for debugger to connect...
Program started.
 
Upvote 0
Top