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

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

      1. 图像质量在 Java Graphics2D Rotate 中被破坏

        Image Quality Gets Ruined In Java Graphics2D Rotate(图像质量在 Java Graphics2D Rotate 中被破坏)

          <legend id='fe94Y'><style id='fe94Y'><dir id='fe94Y'><q id='fe94Y'></q></dir></style></legend>
          <tfoot id='fe94Y'></tfoot>

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

                • <small id='fe94Y'></small><noframes id='fe94Y'>

                    <tbody id='fe94Y'></tbody>
                • 本文介绍了图像质量在 Java Graphics2D Rotate 中被破坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在使用 Graphics2D 旋转方法旋转图像时遇到问题.

                  I am experiencing an issue with rotating an Image with the Graphics2D rotate method.

                  这是我遇到的问题的图片:

                  Here's an image of the issue I'm having:

                  当我移动球时,图像在旋转时完全扭曲.

                  As I move the ball, the image gets completely distorted as it rotates.

                  这是我的旋转方法:

                  public static void rotate(BufferedImage img, Rectangle rect, int degrees) { 
                      Graphics2D g = (Graphics2D) img.createGraphics();
                      g.rotate(degrees, rect.x + rect.width/2, rect.y + rect.height/2);
                      g.drawImage(img, rect.x, rect.y, rect.width, rect.height, null);
                      g.dispose();
                  }
                  

                  我可以做些什么来避免质量损失?

                  Is there anything I can do to avoid the quality loss?

                  推荐答案

                  那么当前随着球的移动,你将图像旋转几度并用新的图像覆盖原始图像?每次旋转图像时,都会添加一点点失真;经过多次旋转,扭曲变得更加复杂.

                  So currently as the ball moves, you rotate the image a few degrees and overwrite the original image with the new one? Each time the image is rotated, a tiny bit of distortion is added; over many rotations, the distortion is compounded.

                  相反,只需将原始图像保存在内存中,并存储它应该在屏幕上显示的旋转度数.然后每次渲染时,将原始图像旋转当前的度数.

                  Instead, just keep the original image in memory and also store the number of degrees it should appear to be rotated on screen. Then each time you render it, rotate the original image by the current number of degrees.

                  这篇关于图像质量在 Java Graphics2D Rotate 中被破坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Java Bytecode Manipulation Library Suggestions(Java 字节码操作库建议)
                  Java CLI UI-design: frameworks or libraries?(Java CLI UI 设计:框架还是库?)
                  About the use of Beans.xml configuration file in Spring Framework application(关于Spring Framework应用中Beans.xml配置文件的使用)
                  What is the difference between Spring, Struts, Hibernate, JavaServer Faces, Tapestry?(Spring、Struts、Hibernate、JavaServer Faces、Tapestry 有什么区别?)
                  Are there any android application framework like spring?(有没有像spring这样的android应用程序框架?)
                  Java Swing based game framework. Any advice?(基于 Java Swing 的游戏框架.有什么建议吗?)
                  1. <legend id='ljHaq'><style id='ljHaq'><dir id='ljHaq'><q id='ljHaq'></q></dir></style></legend>
                      <i id='ljHaq'><tr id='ljHaq'><dt id='ljHaq'><q id='ljHaq'><span id='ljHaq'><b id='ljHaq'><form id='ljHaq'><ins id='ljHaq'></ins><ul id='ljHaq'></ul><sub id='ljHaq'></sub></form><legend id='ljHaq'></legend><bdo id='ljHaq'><pre id='ljHaq'><center id='ljHaq'></center></pre></bdo></b><th id='ljHaq'></th></span></q></dt></tr></i><div id='ljHaq'><tfoot id='ljHaq'></tfoot><dl id='ljHaq'><fieldset id='ljHaq'></fieldset></dl></div>
                      • <bdo id='ljHaq'></bdo><ul id='ljHaq'></ul>
                          1. <tfoot id='ljHaq'></tfoot>

                              <tbody id='ljHaq'></tbody>

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