图片的放大,缩小,还原。
2016-03-18 22:51
337 查看
实现图片的放大,缩小,与还原。
异常处理源码:
try {
mt.waitForAll();
} catch (Exception ex)
{
ex.printStackTrace();
扫描图像文件
public boolean accept(File file)
{String name = file.getName().toLowerCase(); //获取文件名
Return name.endsWith(".gif")|| name.endsWith(".jpg")|| name.endsWith(".jpeg")|| file.isDirectory();}
放大与缩小
放大图像:if(button==jbZoomIn)
showImagePane.scaleX = 1.25; //图像x轴方向放大图片
showImagePane.scaleY = 1.25; //图像y轴方向放大图片
缩小图像:if(button==jbZoomOut)
showImagePane.scaleX = 0.8; //图像x轴方向缩小图片
showImagePane.scaleY = 0.8; //图像y轴方向缩小图片
还原图像:if(button==jbReset)
showImagePane.scaleX = 1.0; //图像x轴方向放大图片还原为1.0
showImagePane.scaleY = 1.0; //图像y轴方向放大图片还原为1.0
本程序用到了事件响应:
用行结果:
图片放大
图片的缩小:
原图:
异常处理源码:
try {
mt.waitForAll();
} catch (Exception ex)
{
ex.printStackTrace();
扫描图像文件
public boolean accept(File file)
{String name = file.getName().toLowerCase(); //获取文件名
Return name.endsWith(".gif")|| name.endsWith(".jpg")|| name.endsWith(".jpeg")|| file.isDirectory();}
放大与缩小
放大图像:if(button==jbZoomIn)
showImagePane.scaleX = 1.25; //图像x轴方向放大图片
showImagePane.scaleY = 1.25; //图像y轴方向放大图片
缩小图像:if(button==jbZoomOut)
showImagePane.scaleX = 0.8; //图像x轴方向缩小图片
showImagePane.scaleY = 0.8; //图像y轴方向缩小图片
还原图像:if(button==jbReset)
showImagePane.scaleX = 1.0; //图像x轴方向放大图片还原为1.0
showImagePane.scaleY = 1.0; //图像y轴方向放大图片还原为1.0
本程序用到了事件响应:
用行结果:
图片放大
图片的缩小:
原图:
相关文章推荐
- JS浮点数运算BUG破法
- google方程式
- Java 被访问时报 the method getDispatcherType() is undefined for the type HttpServletRequest
- 北化oj 2101 - 程序改错 - 两数交换(二)
- 归并排序
- centos7 无线网卡驱动的安装及无线网络的配置
- self.x和_x区别
- SQL Server中TOP子句可能导致的问题以及解决办法
- 序列化与反序列化总结(Serializable和Parcelable)
- JUnit 3.8 让所有测试程序 实现 复合的测试(TestSuite)
- android broadcastReceiver学习
- C语言使用const定义数组时的错误原因
- nsoj L. Find a way
- 条款40:将std::atomic用于并发,而volatile用于专有内存
- 几个小例子让你分清super和this
- yum list
- 建立一颗多叉树
- 1004-格子中输出
- android studio NDK-JNI调用
- hdu 5640 King's Cake(模拟)