旋转的ImageViews彼此重叠

时间:2017-08-30 15:24:57

标签: image javafx rotation imageview image-rotation

我想将旋转的ImageView添加到VBox。我的问题是ImageViews彼此重叠,我不知道如何解决这个问题。谁能帮我?那会很酷!谢谢!

我的轮换代码:

private ImageView normalizeOrientation(int orientation, ImageView iv){
        switch (orientation){
            case 2:
                iv.setRotationAxis(Rotate.Y_AXIS);
                iv.setRotate(180);
                break;
            case 3:
                iv.setRotate(180);
                break;
            case 4:
                iv.setRotate(180);
                iv.setRotationAxis(Rotate.Y_AXIS);
                iv.setRotate(180);
            case 5:
                iv.setRotate(90);
                iv.setRotationAxis(Rotate.Y_AXIS);
                iv.setRotate(180);
                break;
            case 6:
                iv.setRotate(90);
                break;
            case 7:
                iv.setRotate(270);
                iv.setRotationAxis(Rotate.Y_AXIS);
                iv.setRotate(180);
                break;
            case 8:
                iv.setRotate(270);
                break;
            default:
                break;
        }
        return iv;
    }

将旋转的图像添加到VBox后会发生这种情况:

Overlapping Images in a VBox

0 个答案:

没有答案