Examples of BackgroundSize


Examples of javafx.scene.layout.BackgroundSize

                        break;
                }
                if(image!=null){
                    fillFrame=new Background(new BackgroundImage(image,
                                            BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT,
                                            BackgroundPosition.CENTER, new BackgroundSize(width,height,false,false,false,true)));
                }
                resize();
            });
        } else {
            resize();
View Full Code Here

Examples of org.xhtmlrenderer.css.style.BackgroundSize

                    c);
        }
    }

    private void scaleBackgroundImage(CssContext c, CalculatedStyle style, Rectangle backgroundContainer, FSImage image) {
        BackgroundSize backgroundSize = style.getBackgroundSize();

        if (! backgroundSize.isBothAuto()) {
            if (backgroundSize.isCover() || backgroundSize.isContain()) {
                int testHeight = (int)((double)image.getHeight() * backgroundContainer.width / image.getWidth());
                if (backgroundSize.isContain()) {
                    if (testHeight > backgroundContainer.height) {
                        image.scale(-1, backgroundContainer.height);
                    } else {
                        image.scale(backgroundContainer.width, -1);
                    }
                } else if (backgroundSize.isCover()) {
                    if (testHeight > backgroundContainer.height) {
                        image.scale(backgroundContainer.width, -1);
                    } else {
                        image.scale(-1, backgroundContainer.height);
                    }
                }
            } else {
                int scaledWidth = calcBackgroundSizeLength(c, style, backgroundSize.getWidth(), backgroundContainer.width);
                int scaledHeight = calcBackgroundSizeLength(c, style, backgroundSize.getHeight(), backgroundContainer.height);

                image.scale(scaledWidth, scaledHeight);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.