当前位置: 首页>>代码示例>>Java>>正文


Java ImageView.setLayoutY方法代码示例

本文整理汇总了Java中javafx.scene.image.ImageView.setLayoutY方法的典型用法代码示例。如果您正苦于以下问题:Java ImageView.setLayoutY方法的具体用法?Java ImageView.setLayoutY怎么用?Java ImageView.setLayoutY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.image.ImageView的用法示例。


在下文中一共展示了ImageView.setLayoutY方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: displayImg

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
public void displayImg(ImageView imgViewPoped, String title) {
    Stage popOut = new Stage();
    Pane pane = new Pane();
    imgViewPoped.setLayoutX(0);
    imgViewPoped.setLayoutY(0);
    imgViewPoped.fitWidthProperty().bind(pane.widthProperty());
    imgViewPoped.fitHeightProperty().bind(pane.heightProperty());
    pane.getChildren().add(imgViewPoped);
    Scene scene = new Scene(pane, 1280, 900);
    popOut.setTitle(title);
    popOut.setScene(scene);
    popOut.show();
}
 
开发者ID:maximstewart,项目名称:UDE,代码行数:14,代码来源:BackgroundMngrController.java

示例2: openImage

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
private void openImage() {
    Stage imagStage = new Stage();
    Pane pane = new Pane();
    ImageView iView = new ImageView(img);
    pane.getChildren().add(iView);
    iView.setLayoutX(0);
    iView.setLayoutY(0);
    iView.fitWidthProperty().bind(pane.widthProperty());
    iView.fitHeightProperty().bind(pane.heightProperty());
    iView.setPreserveRatio(true);
    Scene scene = new Scene(pane, 800, 800);
    imagStage.setTitle("" + img);
    imagStage.setScene(scene);
    imagStage.show();
}
 
开发者ID:maximstewart,项目名称:UDE,代码行数:16,代码来源:Icon.java

示例3: snapshotNode

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
private void snapshotNode(Scene scene, Node node) {
    SnapshotParameters params = new SnapshotParameters();
    Bounds layoutBounds = node.getLayoutBounds();
    Bounds bounds = node.localToScene(layoutBounds);

    if (!(bounds.getWidth() > 0 && bounds.getHeight() > 0)) {
        return;
    }

    params.setViewport(new Rectangle2D(bounds.getMinX(), bounds.getMinY(), bounds.getWidth(), bounds.getHeight()));
    WritableImage writable = new WritableImage((int) bounds.getWidth(), (int) bounds.getHeight());
    writable = scene.getRoot().snapshot(params, writable);

    ImageView imageView = new ImageView(writable);
    imageView.getStyleClass().add("snapshot-image");
    imageView.setManaged(false);
    imageView.setLayoutX(bounds.getMinX());
    imageView.setLayoutY(bounds.getMinY());
    imageView.setFitWidth(bounds.getWidth());
    imageView.setFitHeight(bounds.getHeight());

    Region rect = new Region();
    rect.getStyleClass().add("snapshot-background");
    rect.setLayoutX(bounds.getMinX() - 5);
    rect.setLayoutY(bounds.getMinY() - 5);
    rect.resize(bounds.getWidth() + 10, bounds.getHeight() + 10);
    rect.setManaged(false);

    Line line = new Line();
    line.setStartX(bounds.getMaxX() + 4);
    line.setStartY(bounds.getMaxY() + 4);
    line.setEndX(bounds.getMaxX() + 200);
    line.setEndY(bounds.getMaxY() + 200);
    line.setStroke(imagePattern);
    line.setStrokeWidth(5);
    line.setManaged(false);

    getChildren().addAll(rect, imageView); //, line);
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:40,代码来源:IntroPaneSkin.java


注:本文中的javafx.scene.image.ImageView.setLayoutY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。