Ossama
Ossama

Reputation: 2433

Progress filling an image with another image using JavaFX

I'm trying to fill an image progressively with another image using javaFX. The progress will vary from 0% to 100% depending on a variable fed from mysql so that when 100% is complete the first image will disappear.

The easiest way I can think of is creating an image for each 1%. But believe there is an easier way through code. Pleases help.

Could ImagePatern be used perhaps?

Thanks a lot for your help !

Upvotes: 1

Views: 58

Answers (1)

Prayag
Prayag

Reputation: 101

I think you can play with opacity ratio with two images Eg. image1.setOpacity(value1) and image2.setOpacity(value2) in that value1 will be decreasing and value2 will be increasing. When value1 rached 0 image will be disappears.

Upvotes: 2

Related Questions