JavaFX Effects MotionBlur - JavaFX

What is JavaFX Effects MotionBlur?

Similar to Gaussian impact, motion Blur is an impact to blur the nodes in JavaFX. It also uses a Gaussian Convolution Kernel that helps in generating the blurring impact. The only difference among Gaussian impact and motion Blur is that the Gaussian Convolution Kernel is used with a specific angle.

As indicated by the name, on making use of this effect by using specifying a few angle, the given enter seems to you as if you are seeing it even as it is in motion.

The class named MotionBlur of the package javafx.scene.effect represents the motion Blur impact. This class includes three properties, which include −

  • Input − This assets is of the type effect and it represents an enter to the box blur impact.
  • Radius − This assets is of double type representing the radius with which the motion Blur effect is to be applied.
  • Angle − this is a assets of double type and it represents the angle of the motion impact in levels.

Example

The following program is an example demonstrating the motion Blur effect. In right here, we are drawing the text “Welcome to wisdomjobs” full of DARKSEAGREEN color and making use of motion Blur impact to it with an angle of 45 levels.

Save this code in a file with the name MotionBlurEffectExample.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 - MotionBlur

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

JavaFX Topics