<tfoot id='RuigM'></tfoot>

    1. <legend id='RuigM'><style id='RuigM'><dir id='RuigM'><q id='RuigM'></q></dir></style></legend>
      <i id='RuigM'><tr id='RuigM'><dt id='RuigM'><q id='RuigM'><span id='RuigM'><b id='RuigM'><form id='RuigM'><ins id='RuigM'></ins><ul id='RuigM'></ul><sub id='RuigM'></sub></form><legend id='RuigM'></legend><bdo id='RuigM'><pre id='RuigM'><center id='RuigM'></center></pre></bdo></b><th id='RuigM'></th></span></q></dt></tr></i><div id='RuigM'><tfoot id='RuigM'></tfoot><dl id='RuigM'><fieldset id='RuigM'></fieldset></dl></div>
      • <bdo id='RuigM'></bdo><ul id='RuigM'></ul>

      <small id='RuigM'></small><noframes id='RuigM'>

    2. Java2D - 如何旋转图像并保存结果

      时间:2023-09-25

      <small id='10kpp'></small><noframes id='10kpp'>

        1. <tfoot id='10kpp'></tfoot>
              <tbody id='10kpp'></tbody>
              <bdo id='10kpp'></bdo><ul id='10kpp'></ul>

                <i id='10kpp'><tr id='10kpp'><dt id='10kpp'><q id='10kpp'><span id='10kpp'><b id='10kpp'><form id='10kpp'><ins id='10kpp'></ins><ul id='10kpp'></ul><sub id='10kpp'></sub></form><legend id='10kpp'></legend><bdo id='10kpp'><pre id='10kpp'><center id='10kpp'></center></pre></bdo></b><th id='10kpp'></th></span></q></dt></tr></i><div id='10kpp'><tfoot id='10kpp'></tfoot><dl id='10kpp'><fieldset id='10kpp'></fieldset></dl></div>
                <legend id='10kpp'><style id='10kpp'><dir id='10kpp'><q id='10kpp'></q></dir></style></legend>
              • 本文介绍了Java2D - 如何旋转图像并保存结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在制作一个游戏,其中一些物体旋转以面对它们正在射击的物体.拍摄之间有延迟,我希望物体一直面向它所在的位置,直到再次拍摄.我知道如何加载图像,也知道如何使用 AffineTransform 旋转它们.但是有了这个,我需要在每次绘制对象时计算旋转.

                I'm making a game where some objects rotate to face what they're shooting at. There's a delay in between shooting and I want the object to keep facing where it is until it shoots again. I know how to load images and I know how to rotate them using AffineTransform. But with this I need to calculate the rotate every time the object gets drawn.

                所以我的问题是如何旋转图像并将结果保存到可以显示的新图像中?

                So my question is how can I rotate an image and save the result into a new image that would get displayed?

                推荐答案

                如何旋转图像并将结果保存到可以显示的新图像中?

                创建一个新的 BufferedImage.获取 Graphics 对象(通过 BufferedImage.getGraphics(). 将旋转后的图像绘制到这个缓冲图像上,并将图像保存在数组或基于它的旋转(以便在需要时轻松查找).

                Create a new BufferedImage. Get hold of a Graphics object (through BufferedImage.getGraphics(). Paint the rotated image onto this buffered image, and save the image in an array or a map based on its rotation (so that it easy to look it up when you need it).

                这篇关于Java2D - 如何旋转图像并保存结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何围绕另一个点旋转一个点 下一篇:如何在不使用存储阵列的情况下将二维阵列旋转 90 度?

                相关文章

                <i id='tin5p'><tr id='tin5p'><dt id='tin5p'><q id='tin5p'><span id='tin5p'><b id='tin5p'><form id='tin5p'><ins id='tin5p'></ins><ul id='tin5p'></ul><sub id='tin5p'></sub></form><legend id='tin5p'></legend><bdo id='tin5p'><pre id='tin5p'><center id='tin5p'></center></pre></bdo></b><th id='tin5p'></th></span></q></dt></tr></i><div id='tin5p'><tfoot id='tin5p'></tfoot><dl id='tin5p'><fieldset id='tin5p'></fieldset></dl></div>

                1. <small id='tin5p'></small><noframes id='tin5p'>

                      <bdo id='tin5p'></bdo><ul id='tin5p'></ul>
                    <tfoot id='tin5p'></tfoot>
                  1. <legend id='tin5p'><style id='tin5p'><dir id='tin5p'><q id='tin5p'></q></dir></style></legend>