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

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

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

ImageView.translateXProperty介绍

暂无

代码示例

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

private void calculateNewDimenstions(OpenPatricianRadioButton radioButton, String text, Image rbBG) {
  InputStream is;
  final int remainWidth = 28; // width that is left from the background
  final int destHight = 27;
  final double xStart = rbBG.getWidth();
  final int yStart = 0;
  Dimension2D dim = sizing.calculate(text, radioButton.getFont());
  double width = dim.getWidth();
  double destWidth = width-remainWidth + 10;
  String fileName = imageFactory.getFileNameExt(destWidth,destHight,remainWidth);
  is = getClass().getResourceAsStream(fileName);
  Image slab = new Image(is, destWidth, destHight, false, true);
  slabView.setImage(slab);
  slabView.translateXProperty().set(xStart);
  slabView.translateYProperty().set(yStart);
  double posX = destWidth/2+(xStart-remainWidth-10);
  label.translateXProperty().set(posX);
}

代码示例来源:origin: net.sf.dcutils/dcutils

public void setCenter(Point2D center) {
 this.center = center;
 this.sprite.translateXProperty().set(this.center.getX() - this.sprite.getImage().getWidth() / 2d);
 this.sprite.translateYProperty().set(this.center.getY() - this.sprite.getImage().getHeight() / 2d);
} // END setCenter

相关文章