Package java.awt

Examples of java.awt.TexturePaint


        if (a % 2 == 1) a++;
        BufferedImage bi = new BufferedImage(a, a, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = bi.createGraphics();
        g2.setColor(c);
        g2.fillRect(0, 0, a/2, a);
        return new TexturePaint(bi, new Rectangle(0, 0, a, a));
    }
View Full Code Here


        if (a % 2 == 1) a++;
        BufferedImage bi = new BufferedImage(a, a, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = bi.createGraphics();
        g2.setColor(c);
        g2.fillRect(0, 0, a, a/2);
        return new TexturePaint(bi, new Rectangle(0, 0, a, a));
    }
View Full Code Here

        if (a % 2 == 1) a++;
        BufferedImage bi = new BufferedImage(a, a, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = bi.createGraphics();
        g2.setColor(c);
        g2.fill(new Polygon(new int[] {a/2, a, a/2, 0}, new int[] {0, a/2, a, a/2}, 4));
        return new TexturePaint(bi, new Rectangle(0, 0, a, a));
    }
View Full Code Here

        BufferedImage bi = new BufferedImage(a, a, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = bi.createGraphics();
        g2.setColor(c);
        g2.fillRect(0, 0, a/2, a/2);
        g2.fillRect(a/2, a/2, a/2, a/2);
        return new TexturePaint(bi, new Rectangle(0, 0, a, a));
    }
View Full Code Here

        g2.setColor(c);
        g2.fillRect(0, 3*a/4, a/2, a/4);
        g2.fillRect(a/4, 0, a/4, a/4);
        g2.fillRect(a/4, a/4, 3*a/4, a/4);
        g2.fillRect(3*a/4, a/2, a/4, a/2);
        return new TexturePaint(bi, new Rectangle(0, 0, a, a));
    }
View Full Code Here

        g2.setColor(c);
        g2.fillRect(a/4, 0, 3*a/4, a/4);
        g2.fillRect(a/4, a/4, a/4, a/4);
        g2.fillRect(0, a/2, a/2, a/4);
        g2.fillRect(3*a/4, a/2, a/4, a/2);
        return new TexturePaint(bi, new Rectangle(0, 0, a, a));
    }
View Full Code Here

                Rectangle bodyRect = displayedGem.getDisplayedBodyPart().getBounds();
                Paint redGradientPaint = new GradientPaint(0, 0, Color.RED, 25, 32, getTableTopBaseColour(), true);
                Paint gemColourGradientPaint = new GradientPaint(0, 0, new Color(5, 5, 5, 200), 25, 32, new Color(5, 5, 5, 75), true);

                BufferedImage image = getTargetImage(bodyRect.width, bodyRect.height, gemColourGradientPaint, redGradientPaint);
                paint = new TexturePaint(image, bodyRect);
           
            } else {
                paint = gemColour;
            }
            paintBodyOval(displayedGem, paint, g2d);
View Full Code Here

                BufferedImage bi =
                    new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g = (Graphics2D) bi.getGraphics();
                g.setPaint(createPaint(PaintType.LINEAR_GRADIENT, 0, 0, w, h));
                g.fillRect(0, 0, w, h);
                return new TexturePaint(bi, r);
            }
        }
        return Color.green;
    }
View Full Code Here

         *   - the texture image can be (or is already) cached in an OpenGL
         *     texture object
         */
        @Override
        boolean isPaintValid(SunGraphics2D sg2d) {
            TexturePaint paint = (TexturePaint)sg2d.paint;
            OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
            BufferedImage bi = paint.getImage();

            // see if texture-non-pow2 extension is available
            if (!dstData.isTexNonPow2Available()) {
                int imgw = bi.getWidth();
                int imgh = bi.getHeight();
View Full Code Here

         *   - the texture image can be (or is already) cached in a D3D
         *     texture object
         */
        @Override
        public boolean isPaintValid(SunGraphics2D sg2d) {
            TexturePaint paint = (TexturePaint)sg2d.paint;
            D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData;
            BufferedImage bi = paint.getImage();

            // verify that the texture image dimensions are pow2
            D3DGraphicsDevice gd =
                (D3DGraphicsDevice)dstData.getDeviceConfiguration().getDevice();
            int imgw = bi.getWidth();
View Full Code Here

TOP

Related Classes of java.awt.TexturePaint

Copyright © 2018 www.massapicom. 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.