5 Replies Latest reply: Feb 26, 2013 7:13 PM by SlashWang RSS

    Big background image in css lead great memory leak?

      Big background image in css lead great memory leak?

      Does this jira problem now has a way?

      In my project, I found when use big images in css file. (some images are 1280*800 and size of 80k)
      Then we use xxControl.setId("imagecssid");

      The memory get higher and higher when I switch the pages which have big image css style.

      How can we decrease the memory use?

      1. Now our project has a UCD team, they made nice images as pages' background, so I think we can't give the images up.
      2. Can we use ImageView as the control's(eg.VBox) background image(instead of css background)?
      How to use it? Pls give me some code.

      I tried this, but it doesn't work:
      Image serviceInforImage = new Image(ResourceUtil.getImage(classLoader, "inspecttemplate.png"));
      ImageView background = new ImageView(serviceInforImage);
      here is the css file:     
      -fx-background-repeat: no-repeat;
      -fx-background-position: left top;
      -fx-background-size: stretch;

      Now the image of "centerHBox" covered the whole page, and we can't use tool anymore.
      "-fx-background-position: left top; -fx-background-size: stretch;" in css doesn't work.