e675. 翻转缓冲图像
2024-09-03 03:30:24
// To create a buffered image, see e666 创建缓冲图像 // Flip the image vertically
AffineTransform tx = AffineTransform.getScaleInstance(1, -1);
tx.translate(0, -image.getHeight(null));
AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
bufferedImage = op.filter(bufferedImage, null); // Flip the image horizontally
tx = AffineTransform.getScaleInstance(-1, 1);
tx.translate(-image.getWidth(null), 0);
op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
bufferedImage = op.filter(bufferedImage, null); // Flip the image vertically and horizontally;
// equivalent to rotating the image 180 degrees
tx = AffineTransform.getScaleInstance(-1, -1);
tx.translate(-image.getWidth(null), -image.getHeight(null));
op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
bufferedImage = op.filter(bufferedImage, null);
Related Examples |
最新文章
- BFS
- noip模拟赛 纸壳子
- Webkit CSS properties
- ubuntu的目录结构
- 4-Highcharts 3D图之3D普通饼图
- WSB备份到远程共享文件夹的限制
- Java中注解Annotation的定义、使用、解析
- Gulp实战和原理解析
- RTMP、RTSP、HTTP视频协议详解(转)
- python 读取SQLServer数据插入到MongoDB数据库中
- Linux Shell编程(6)——变量替换
- python之安装
- c++对文件操作的支持(二)
- C# 时间格式总结
- Vue组件库的那些事儿,你都知道吗?
- python编码问题和逻辑运算
- 修改eclipse的workspace目录
- ldap集成bitbucket
- requests库(爬虫)
- Java HashMap 遍历、删除、排序