Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8092891

JavaFX BlendMode.SRC_ATOP effect does not work on Mac?

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 7u6
    • 8
    • docs
    • JDK1.7.0_11
      Mac OS X 10.7.4

    Description

      I am not sure if this is a bug.
      I transcribed all of this article. http://docs.oracle.com/javafx/2/visual_effects/jfxpub-visual_effects.htm
      The result that I saw was different from what I saw in above web site.
      The code is here

      public class BlendSample extends Application {
          @Override
          public void start(Stage stage) throws Exception {
              HBox root = new HBox();
              root.setPadding(new Insets(10));
              root.setSpacing(8);
              // Blending
              Node node1 = getBlendMode(BlendMode.MULTIPLY, Color.BLUE);
              Node node2 = getBlendMode(BlendMode.SRC_ATOP, Color.ORANGE); // This has the different result
              Node node3 = getBlendMode(BlendMode.SRC_OVER, Color.AQUA);
              root.getChildren().addAll(node1, node2, node3);
              stage.setScene(new Scene(root, 500, 300));
              stage.show();
          }

          static Node getBlendMode(BlendMode mode, Color color) {
              Rectangle r = new Rectangle();
              r.setX(590);
              r.setY(50);
              r.setWidth(50);
              r.setHeight(50);
              r.setFill(color);

              Circle c = new Circle();
              c.setFill(Color.rgb(255, 0, 0, 0.5f));
              c.setCenterX(590);
              c.setCenterY(50);
              c.setRadius(25);

              Group g = new Group();
              g.setBlendMode(mode);
              g.getChildren().add(r);
              g.getChildren().add(c);
              return g;
          }


      For your reference please see my blog
      http://d.hatena.ne.jp/tomoTaka/20130119/1358580757
      Thank you in advance for your help.

      Attachments

        Activity

          People

            ifedortsova Irina Fedortsova (Inactive)
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: