javafx image zoom
public class EffectTest extends Application {
private final ImageView imageView = new ImageView();
private final ScrollPane scrollPane = new ScrollPane();
final DoubleProperty zoomProperty = new SimpleDoubleProperty();
@Override
public void start(Stage stage) throws Exception {
zoomProperty.addListener((Observable arg0) -> {
imageView.setFitWidth(zoomProperty.get() * );
imageView.setFitHeight(zoomProperty.get() * );
});
scrollPane.addEventFilter(ScrollEvent.ANY, (ScrollEvent event) -> {
if (event.getDeltaY() > ) {
zoomProperty.set(zoomProperty.get() * 1.1);
} else if (event.getDeltaY() < ) {
zoomProperty.set(zoomProperty.get() / 1.1);
}
});
Image image1 = new Image(EffectTest.class.getResourceAsStream("/effecttest/img/1156909.png"));
imageView.setImage(image1);
imageView.preserveRatioProperty().set(true);
scrollPane.setContent(imageView);
stage.setScene(new Scene(scrollPane, , ));
stage.show();
}
}
//
javafx image zoom的更多相关文章
- 问题记录:JavaFx 鼠标滑轮滚动事件监听!
问题描述: 在listview的item里面添加鼠标拖拽排序功能.代码如下: setOnMouseDragged(event -> { //设定鼠标长按0.3秒后才可拖拽 防止误操作 isCan ...
- Nike Zoom Winflo 2 Kvinder Sko Når jeg set elementet
De fleste af os elskede denne Nike Pegasus 34 foruden var ved at blive begejstret for at få dine ben ...
- css zoom属性兼容ie,firefox,chrome
jquery代码: $("body").css({ "zoom":"2", "transform":"scal ...
- JavaFx客户端服务器C/S架构搭建
客户端获取服务器端软件更新版本方法: package com.platform.ui.update; import java.io.BufferedInputStream; import java.i ...
- Selenium通过WebDriver控制IE浏览器出错 Browser zoom level was set to 109%. It should be set to 100%
错误信息: WebDriverException: Message: Unexpected error launching Internet Explorer. Browser zoom level ...
- 关于scale和zoom的区别
其实关于scale,我之前是用他来搞一些css3的特效的放大缩小啊,玩的也挺6666,而*zoom:1之前是用来做css的hack,也就是触发IE6/7的haslayout清除浮动的.终于某天,好事的 ...
- JavaFX 教程资料收集
1. JavaFX中文资料 http://www.javafxchina.net/blog/docs/tutorial1/ 2. JavaFX入门教程 http://www.xrpmoon.com/c ...
- [WPF系列]-Deep Zoom
参考 Deep Zoom in Silverlight
- CSS中不为人知Zoom属性的使用介绍(IE私有属性)
其实Zoom属性是IE浏览器的专有属性,Firefox等浏览器不支持.它可以设置或检索对象的缩放比例.除此之外,它还有其他一些小作用,比如触发ie的hasLayout属性,清除浮动.清除margin的 ...
随机推荐
- PyCharm 2017 Mac 免注册版破解安装说明
PyCharm 2017 Mac 免注册版破解安装说明 下载完成安装包后,双击打开,将左侧拖拽至右侧应用程序,默认安装. 打开软件,在License server address中填入[http:// ...
- 用 while 循环做个小游戏
import random #可输入次数 flag = 0 #生成一个1到10之间的随机整数 res = random.randint(1,10) #判读三次输入机会 while(flag<3) ...
- python在leecode刷题-第一题和第七题
class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] num ...
- 题解 CF915D 【Almost Acyclic Graph】
这道题我第一次的想法是直接判环的数量,然而事实证明实在是太naive了. 随便画个图都可以卡掉我的解法.(不知道在想什么) 这道题的正解是拓扑排序. 朴素的想法是对所有边都跑一次拓扑,但这样$O(m( ...
- C++归并算法
#include <iostream> using namespace std; void DealWhat(int ar[],int start,int end,int b[]) { i ...
- hdu1280 前m大的数(数组下标排序)
前m大的数 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Subm ...
- Ubuntu 安装软件和centos 对比命令
之前都是使用Redhat 或者Centos 等rpm的linux ,开始使用ubuntu 很不习惯 1. 安装命令Centos : yum install httpd ...
- Spring MVC 注解式
1.注解式控制器简介 一.Spring2.5之前,我们都是通过实现Controller接口或其实现来定义我们的处理器类.已经@Deprecated. 二.Spring2.5引入注解式处理器支持,通 ...
- 暑假集训-WHUST 2015 Summer Contest #0.1
ID Origin Title 4 / 12 Problem A Gym 100589A Queries on the Tree 14 / 41 Problem B Gym 100589B Cou ...
- Linux下查看进程IO工具iopp
Linux下的IO检测工具最常用的是iostat,不过iostat只能查看到总的IO情况.如果要细看具体那一个程序点用的IO较高,可以使用iotop .不过iotop对内核版本和Python版本有要求 ...