Package javafx.scene

Examples of javafx.scene.SnapshotParameters


        if (node != null) {
            if (node instanceof ImageView) {
                this.imageProperty.set(((ImageView) node).getImage());
            } else {
                final WritableImage wi = node.snapshot(new SnapshotParameters(), null);
                this.imageProperty.set(wi);
            }
        }

        final double width = getImage().getWidth();
View Full Code Here


    private void addBlurLayer() {
        setVisible(false);
        getChildren().removeAll(blurView, colorGlass);

        SnapshotParameters parameters = new SnapshotParameters();
        Point2D startPointInScene = localToScene(0, 0);
        Rectangle2D toPaint = new Rectangle2D(startPointInScene.getX(), startPointInScene.getY(), getLayoutBounds().getWidth(), getLayoutBounds().getHeight());
        parameters.setViewport(toPaint);
        WritableImage image = new WritableImage((int) toPaint.getWidth(), (int) toPaint.getHeight());
        image = getScene().getRoot().snapshot(parameters, image);
        blurView.setImage(image);
        getChildren().addAll(blurView, colorGlass);
        colorGlass.toBack();
View Full Code Here

      }
    };
    final Scale scale = new Scale();
    scale.xProperty().bind(localScaleFactor);
    scale.yProperty().bind(localScaleFactor);
    param = new SnapshotParameters();
    param.setDepthBuffer(true);
    param.setTransform(scale);

    final StackPane mainContent = new StackPane();
    final Circle frame = new Circle();
View Full Code Here

            controller.pushZoomInTime();
        });

        snapShotButton.setOnAction((ActionEvent event) -> {
            //take snapshot
            final SnapshotParameters snapshotParameters = new SnapshotParameters();
            snapshotParameters.setViewport(new Rectangle2D(visualization.getBoundsInParent().getMinX(), visualization.getBoundsInParent().getMinY(),
                                                           visualization.getBoundsInParent().getWidth(),
                                                           contextPane.getLayoutBounds().getHeight() + visualization.getLayoutBounds().getHeight() + partPane.getLayoutBounds().getHeight()
            ));
            WritableImage snapshot = this.snapshot(snapshotParameters, null);
            //pass snapshot to save action
View Full Code Here

            Canvas canvas = new Canvas(image.getWidth(), image.getHeight());
            GraphicsContext gc = canvas.getGraphicsContext2D();
            gc.drawImage(image, 0, 0);
            gc.applyEffect(colorAdjust);
            WritableImage colouredImage = new WritableImage((int) image.getWidth(), (int) image.getHeight());
            canvas.snapshot(new SnapshotParameters(), colouredImage);
            coverImageView.setImage(colouredImage);
            // Convert to a PNG and store in the project model.
            ImageIO.setUseCache(false);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ImageIO.write(SwingFXUtils.fromFXImage(colouredImage, null), "png", baos);
View Full Code Here

TOP

Related Classes of javafx.scene.SnapshotParameters

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.