旋转 BufferedImage 中的图块
我创建了 2 行 3 列 6 个图块的 bufferedImage,我想旋转第二行的最后一个图块。该图块充当我的动画的交叉点。
我的问题是:
我如何才能单独访问该特定图块并单独旋转它而不影响其他人。
我用谷歌搜索了一段时间但没有答案。
I have created a a bufferedImage of 6 tiles of 2 rows and 3 columns and i want to rotate the last tile of the second row. This tile serves as a crossing for my animation.
My problems are :
How can i get access to that specifc tile alone and rotate it alone without affecting others.
I have googled for a while but no answer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
阅读此关于如何使用 AffineTransform 和 AffineTransformOp。如果您查看javadoc。免责声明:我自己从未这样做过。这纯粹是基于研究的答案。
Read this sample code on how torotate a WritableRaster using AffineTransform and AffineTransformOp. You should be able to figure out how to obtain a WritableRaster from a tile in a BufferedImage if you look at the javadoc.Disclaimer: I haven't ever done this myself. This is purely a research based answer.