javafx.scene.image.ImageView.setOpacity()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(147)

本文整理了Java中javafx.scene.image.ImageView.setOpacity()方法的一些代码示例,展示了ImageView.setOpacity()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.setOpacity()方法的具体详情如下:
包路径:javafx.scene.image.ImageView
类名称:ImageView
方法名:setOpacity

ImageView.setOpacity介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

private void updatePlaceholder(Node newView) {
    if (view.getWidth() > 0 && view.getHeight() > 0) {
      SnapshotParameters parameters = new SnapshotParameters();
      parameters.setFill(Color.TRANSPARENT);
      Image placeholderImage = view.snapshot(parameters,
        new WritableImage((int) view.getWidth(), (int) view.getHeight()));
      placeholder.setImage(placeholderImage);
      placeholder.setFitWidth(placeholderImage.getWidth());
      placeholder.setFitHeight(placeholderImage.getHeight());
    } else {
      placeholder.setImage(null);
    }
    placeholder.setVisible(true);
    placeholder.setOpacity(1.0);
    view.getChildren().setAll(placeholder, newView);
    placeholder.toFront();
  }
}

代码示例来源:origin: com.bitplan.gui/com.bitplan.javafx

@Override
public void setActive(boolean active) {
 this.active = active;
 if (icon != null)
  if (active) {
   icon.setOpacity(OPACITY_ACTIVE);
  } else {
   icon.setOpacity(OPACITY_INACTIVE);
  }
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-demoapp-components

final ImageView imgView = new ImageView(img);
 getChildren().add(imgView);
 imgView.setOpacity(0.67);
} catch (IOException e) {
 e.printStackTrace();

代码示例来源:origin: io.datafx/flow

private void updatePlaceholder(Node newView) {
    if (root.getWidth() > 0 && root.getHeight() > 0) {
      Image placeholderImage = root.snapshot(null, new WritableImage((int) root.getWidth(), (int) root.getHeight()));
      placeholder.setImage(placeholderImage);
      placeholder.setFitWidth(placeholderImage.getWidth());
      placeholder.setFitHeight(placeholderImage.getHeight());
    } else {
      placeholder.setImage(null);
    }
    placeholder.setVisible(true);
    placeholder.setOpacity(1.0);
    root.getChildren().setAll(placeholder);
    root.getChildren().add(newView);
    placeholder.toFront();

  }
}

代码示例来源:origin: com.github.almasb/fxgl-base

imageView.setLayoutX(x);
imageView.setLayoutY(y);
imageView.setOpacity(alpha);
imageView.setBlendMode(blendMode);

代码示例来源:origin: com.github.almasb/fxgl-effects

imageView.setLayoutX(x);
imageView.setLayoutY(y);
imageView.setOpacity(alpha);
imageView.setBlendMode(blendMode);

相关文章