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 中被破坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
                  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'>