JavaFX Effects Image Input - JavaFX

What is JavaFX Effects Image Input?

Image input impact in JavaFX just embeds an image to the JavaFX screen. similar to in the color input impact, it is used to pass the required colored rectangular area as an enter to another impact. An image enter impact is used to pass the required image as an input to another effect.

On applying this effect, the image specific will now not be changed. This impact is implemented to any node.

The class named ImageInput of the package javafx.scene.effect represents the image input effect, this class includes three properties, which can be −

  • X − This assets is of Double type; it represents the x coordinate of the position of the source picture.
  • Y − This assets is of Double type; it represents the y coordinate of the position of the source picture.
  • Source − his assets is of image type; it represents image that is for use as a source to this impact. (passed as input)

Example

The following program is an example demonstrating the image enter impact. In here, we are developing an photo input at the position 150, 100, and taking the following image (wisdomjobs logo) as a supply for this impact.

logo-wdm


We are developing a rectangle and applying this impact to it. save this code in a file with the name ImageInputEffectExample.java.

Collect and execute the saved java file from the command prompt using the following commands.

On executing, the above program generates a JavaFX window as shown below.

JavaFX Effects - Image Input

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

JavaFX Topics