Wish ColorAdjust class

Jim Brown

Active Member
Licensed User
Longtime User
A great addition to B4J would be support for the JavaFX ColorAdjust class. I could perhaps look at writing a library but I don't really know how to properly implement it.

From the JavaFX API - ColorAdjust

ColorAdjust colorAdjust = new ColorAdjust();
colorAdjust.setContrast(0.1);
colorAdjust.setHue(-0.05);
colorAdjust.setBrightness(0.1);
colorAdjust.setSaturation(0.2);

Image image = new Image("boat.jpg");
ImageView imageView = new ImageView(image);
imageView.setFitWidth(200);
imageView.setPreserveRatio(true);
imageView.setEffect(colorAdjust);​

photo.png
coloradjust.png
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
It should be quite simple to access this API with JavaObject.

Something like:
B4X:
Dim colorAdjust As JavaObject
colorAdjust.InitializeNewInstance("javafx.scene.effect", null)
colorAdjust.RunMethod("setContrast", Array(0.1))
...
Dim jiv As JavaObject = ImageView1
jiv.RunMethod("setEffect", Array(colorAdjust))
 
Last edited:

Swissmade

Well-Known Member
Licensed User
Longtime User
Hi all,

colorAdjust.InitializeNewInstance("javafx.scene.effect", null)
This part I get a error Class not found
I there any sample for this.
I need some color adjustement.
Many thanks for help.
 
Last edited:

Swissmade

Well-Known Member
Licensed User
Longtime User
Thanks Erel

Edit

Working
 
Last edited:
Top