Package java.awt

Examples of java.awt.TexturePaint


        PDSoftMask softMask = getGraphicsState().getSoftMask();
        if (softMask != null)
        {
            BufferedImage image = group.getImage();
            Paint awtPaint = new TexturePaint(image,
                    new Rectangle2D.Float(0, 0, image.getWidth(), image.getHeight()));
            awtPaint = applySoftMaskToPaint(awtPaint, softMask); // todo: PDFBOX-994 problem here?
            graphics.setPaint(awtPaint);
            graphics.fill(new Rectangle2D.Float(0, 0, bbox.getWidth() * (float)xform.getScaleX(),
                                                bbox.getHeight() * (float)xform.getScaleY()));
 
View Full Code Here


        lastPaint = new GDIColor(COLOR_FULL_ALPHA);
        break;
      case BS_HATCHED:
      {
        final BufferedImage image = createHatchStyle();
        lastPaint = new TexturePaint(image, new Rectangle(0, 0, image.getWidth(), image.getHeight()));
        break;
      }
      case BS_DIBPATTERN:
      {
        if (bitmap == null)
        {
          lastPaint = new GDIColor(COLOR_FULL_ALPHA);
        }
        else
        {
          lastPaint = new TexturePaint(bitmap, new Rectangle(0, 0, bitmap.getWidth(), bitmap.getHeight()));
        }
        break;
      }
      default:
      {
View Full Code Here

    setMinimumSize( new Dimension( getMinimumSize().width, barExtent ));
    setPreferredSize( new Dimension( getPreferredSize().width, barExtent ));

    img1    = new BufferedImage( 1, barExtent, BufferedImage.TYPE_INT_ARGB );
    img1.setRGB( 0, 0, 1, barExtent, pntBarGradientPixels, 0, 1 );
    pntBackground = new TexturePaint( img1, new Rectangle( 0, 0, 1, barExtent ));
    img2    = new BufferedImage( 1, markExtent, BufferedImage.TYPE_INT_ARGB );
    img2.setRGB( 0, 0, 1, markExtent, pntMarkGradientPixels, 0, 1 );
    pntMarkFlag  = new TexturePaint( img2, new Rectangle( 0, 0, 1, markExtent ));
    img3    = new BufferedImage( 1, markExtent, BufferedImage.TYPE_INT_ARGB );
    img3.setRGB( 0, 0, 1, markExtent, pntMarkDragPixels, 0, 1 );
    pntMarkFlagDrag = new TexturePaint( img3, new Rectangle( 0, 0, 1, markExtent ));

    setOpaque( true );
// not necessary; it also kills the VK_TAB response of DocumentFrame!
//    setFocusable( true );
View Full Code Here

            else
                cb.setShadingStroke(pat);
        }
        else if (paint instanceof TexturePaint) {
            try {
                TexturePaint tp = (TexturePaint)paint;
                BufferedImage img = tp.getImage();
                Rectangle2D rect = tp.getAnchorRect();
                com.itextpdf.text.Image image = com.itextpdf.text.Image.getInstance(img, null);
                PdfPatternPainter pattern = cb.createPattern(image.getWidth(), image.getHeight());
                AffineTransform inverse = this.normalizeMatrix();
                inverse.translate(rect.getX(), rect.getY());
                inverse.scale(rect.getWidth() / image.getWidth(), -rect.getHeight() / image.getHeight());
View Full Code Here

      Graphics2D g2d = bie.createGraphics();

      g2d.drawImage(img, 0, 0, colBg, null);
     
      Rectangle rec = new Rectangle(0, 0, intSizeSquareIcon, intSizeSquareIcon);
      TexturePaint tpt = new TexturePaint(bie, rec);
     
      g2d.dispose();
      return tpt;
   }
View Full Code Here

      big.fillRect(0, 0, 5, 5);
      big.setColor(Color.DARK_GRAY);
      big.fillRect(1, 3, 1, 1);
      Rectangle r = new Rectangle(0, 0, 5, 5);
     
      return new TexturePaint(bi, r);
   }
View Full Code Here

      big.setColor(Color.DARK_GRAY);
      big.fillRect(1, 1, 5, 1);
      big.fillRect(6, 6, 5, 1);
      Rectangle r = new Rectangle(0, 0, 10, 10);
     
      return new TexturePaint(bi, r);
   }
View Full Code Here

    protected MySurfaceAbs(String strWallPaper)
    {
       
        this._strWallPaper_ = strWallPaper;
        toolkit = getToolkit();
        TexturePaint textTexture = getTextTexture();
       
        this.setTexture(textTexture);
        this.setComposite(true);
        this.setAntiAlias(true);
        this.setRendering(true);
View Full Code Here

        tG2.setBackground(GfrColor.WHITE_2);
        tG2.clearRect(0, 0, sw, sh);
        tG2.setColor(GfrColor.GRAY_8);
        tlt.draw(tG2, 0, tlt.getAscent());
        Rectangle r = new Rectangle(0, 0, sw, sh);
        return new TexturePaint(bi, r);
    }
View Full Code Here

            g.fillRect(size / 2, size / 2, size / 2, size / 2);
        } finally {
            g.dispose();
        }
       
        return new TexturePaint(img,new Rectangle(0,0,size,size));
    }
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.