<small id='0l2DD'></small><noframes id='0l2DD'>

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

      如何旋转 JXImagePanel?

      How to rotate JXImagePanel?(如何旋转 JXImagePanel?)
    1. <legend id='lgm9j'><style id='lgm9j'><dir id='lgm9j'><q id='lgm9j'></q></dir></style></legend>

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

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

                <tbody id='lgm9j'></tbody>
              1. 本文介绍了如何旋转 JXImagePanel?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我想旋转 JXImagePanel.应该有可能 - 这是关于 JXImagePanel:

                I would to rotate JXImagePanel. It should be possible - this is about JXImagePanel:

                • Swing :: JXImagePanel

                虽然 JLabelJButton 允许您轻松地将图像添加到 Swing 应用程序,JXImagePanel 使得将任何 BufferedImageIcon 添加到 Swing 应用程序变得非常容易.

                While JLabel and JButton allow you to easily add images to your Swing applications, the JXImagePanel makes it trivially easy to add any BufferedImage or Icon to your Swing applications.

                如果可编辑,它还为用户提供了一种更改图像的方法.此外,JXImagePanel 提供了许多开箱即用的内置效果,包括TilingScalingRotatingCompositing等等.

                If editable, it also provides a way for the user to change the image. In addition, the JXImagePanel provides many built in effects out-of-the-box, including Tiling, Scaling, Rotating, Compositing, and more.

                但是,我不知道该怎么做.目前我的代码片段是:

                However, I cannot figure out how to do this. Currently my code snippet is:

                bufferedImage = ImageIO.read(new File("image.png"));            
                image = new ImageIcon(bufferedImage).getImage();
                tempImage = image.getScaledInstance(100, 150, Image.SCALE_FAST);
                this.deskJXImagePanel.setImage(tempImage);
                

                现在我想将它旋转 0-360 度.怎么做?

                Now I would like to rotate it in 0-360 degrees. How it can be done?

                推荐答案

                JXImagePanel 已被弃用(实际上,从 1.6.2 开始将包设为私有,因为它仍在内部使用),所以最好不要使用 is,很快就会被删除.

                JXImagePanel is deprecated (actually, made package private as of 1.6.2, because it's still used internally), so better not use is, will be removed soon.

                相反,使用带有 ImagePainter 的 JXPanel 和应用于画家的任意 transformOp,在代码片段中类似于:

                Instead, use a JXPanel with an ImagePainter and an arbitrary transformOp applied to the painter, in code snippets something like:

                    JXPanel panel = new JXPanel();
                    ImagePainter image = new ImagePainter(myImage);
                    image.setFilters(
                            new AffineTransformOp(AffineTransform.getRotateInstance(-Math.PI * 2 / 8, 100, 100), null) 
                            );
                    panel.setBackgroundPainter(image);
                

                您可能需要花一点时间才能获得您想要达到的确切效果.如果遇到问题,您可能想尝试在 Swinglabs 论坛上发帖.

                you'll probably have to play a bit to get the exact effects you want to achieve. On problems, you might want to try posting to the Swinglabs forum.

                这篇关于如何旋转 JXImagePanel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                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 的游戏框架.有什么建议吗?)

                  <legend id='Q011e'><style id='Q011e'><dir id='Q011e'><q id='Q011e'></q></dir></style></legend>
                  1. <small id='Q011e'></small><noframes id='Q011e'>

                        <bdo id='Q011e'></bdo><ul id='Q011e'></ul>
                        <tfoot id='Q011e'></tfoot>

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