2

I create an imageView and resize it. After applying a color effect it gets resized back to original dimensions.

Envi: Oracle JDK 7 (1.7.0_51-b13) and Oracle JDK 8 (8b124-0~webupd8~0)

final ImageView imageView = new ImageView(image);
imageView.setPreserveRatio(true);
imageView.setFitHeight(image.getHeight() * imageViewScale);
imageView.setFitWidth(image.getWidth() * imageViewScale);

Resizing works fine until now. But colorizing it resizes back to embedded image dimensions.

final Blend effect = new Blend(BlendMode.SRC_ATOP, new ImageInput(imageView.getImage()), new ColorInput(0, 0, imageView.getImage().getWidth(), imageView.getImage().getHeight(), color));
imageView.setEffect(effect);

Even a later resetting does not work

imageView.setFitHeight(height);
imageView.setFitWidth(width);

I already tried the approach of the ImageViewPane in https://javafx-jira.kenai.com/browse/RT-21337 but it could not handle the case as well.

Any ideas?

1
  • For sure: A silly workaround might be to replace the imageView by a new one using the Image Constructor with specification of width and height. But that is not the way it should work, I think. Still wondering about this strange behaviour... Jan 31, 2014 at 9:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.