Package java.awt.image

Examples of java.awt.image.BufferedImage.createGraphics()


    double w=pageFormat.getImageableWidth();
    double h=pageFormat.getImageableHeight();
   
    // create image accordingly
    BufferedImage bi=new BufferedImage((int)w,(int)h,BufferedImage.TYPE_3BYTE_BGR);
    Graphics2D g2=bi.createGraphics();
    AffineTransform t=g2.getTransform();
   
    // get diagram size
    Point pmax;
View Full Code Here


   
    Rectangle r=d.getBounds();
    r.width=(int)((double)r.width/d.getZoom());
    r.height=(int)((double)r.height/d.getZoom());
    BufferedImage bi=new BufferedImage(r.width,r.height,BufferedImage.TYPE_3BYTE_BGR);
    Graphics2D g2=bi.createGraphics();
    g2.setColor(sheet.getDiagramParameters().backgr);
    g2.fillRect(0,0,r.width,r.height);
    d.printDiagram(g2);
   
    // add number tags on image
View Full Code Here

    public void render(Graphics2D g) {       
        Dimension d = getPreferredSize();
        BufferedImage im = new BufferedImage((int)d.width,
                                             (int)d.height,
                                             BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = im.createGraphics();
        g2.setColor(Color.white);
        g2.fillRect(0, 0, d.width, d.height);
        g2.setColor(Color.black);
       
        paintDefault(g2);
View Full Code Here

    // scale it to the new size on-the-fly
    thumbImage = new BufferedImage(iThumbWidth, iThumbHeight, BufferedImage.TYPE_INT_RGB);

    if (DebugFile.trace) DebugFile.writeln("java.awt.Graphics2D = thumbImage.createGraphics()");

    graphics2D = thumbImage.createGraphics();
    graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    graphics2D.drawImage(oImg, 0, 0, iThumbWidth, iThumbHeight, null);
    graphics2D.dispose();

    if (DebugFile.trace) DebugFile.writeln("com.sun.image.codec.jpeg.JPEGImageEncoder = JPEGCodec.createJPEGEncoder([OutputStream]);");
View Full Code Here

      BufferedImage oBImg = new BufferedImage(iImageWidth, iImageHeight, BufferedImage.TYPE_INT_RGB);

      if (DebugFile.trace) DebugFile.writeln("java.awt.Graphics2D = thumbImage.createGraphics()");

      Graphics2D graphics2D = oBImg.createGraphics();
      graphics2D.drawImage(oImg, 0, 0, iImageWidth, iImageHeight, null);
      graphics2D.dispose();

      oEnc.encode(oBImg);
View Full Code Here

            int minHeight = Math.min(normalHeight, availableImageHeight);

            BufferedImage bi =
              new BufferedImage(minWidth, minHeight, BufferedImage.TYPE_INT_ARGB);

            Graphics2D g = bi.createGraphics();
            if (printImage.getModeValue() == ModeEnum.OPAQUE)
            {
              g.setColor(printImage.getBackcolor());
              g.fillRect(0, 0, minWidth, minHeight);
            }
View Full Code Here

            Rectangle bounds = r2d.getBounds();
            BufferedImage im = new BufferedImage(bounds.width + MARGIN * 2,
                                                 bounds.height + MARGIN * 2,
                                                 BufferedImage.TYPE_INT_ARGB);

            Graphics2D g2d = im.createGraphics();
            g2d.setColor(Color.WHITE);
            g2d.fillRect(0, 0, im.getWidth(), im.getHeight());

            g2d.setColor(Color.BLACK);
            draw(g2d, rx + MARGIN - bounds.x, ry + MARGIN - bounds.y);
View Full Code Here

      switch (element.getScaleImageValue())
      {
        case CLIP:
        {
          BufferedImage bi = new BufferedImage(availableImageWidth, availableImageHeight, BufferedImage.TYPE_INT_ARGB);
          Graphics2D grx = bi.createGraphics();
         
          int xoffset = (int) (xalignFactor * (availableImageWidth - normalWidth));
          int yoffset = (int) (yalignFactor * (availableImageHeight - normalHeight));

          Shape oldClipShape = grx.getClip();
View Full Code Here

          // in invalid image files for some viewers (browsers)
          (imageType == JRRenderable.IMAGE_TYPE_GIF || imageType == JRRenderable.IMAGE_TYPE_PNG
            ? BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB
          );

      Graphics g = bi.createGraphics();
      g.drawImage(image, 0, 0, null);
      g.dispose();
    }

    return encode(bi, imageType);
View Full Code Here

  }

  private Image createIcon(LayerType type, FeatureStyleInfo fsi, int iconSize, String iconUrl)
      throws AdvancedviewsException {
    BufferedImage bi = new BufferedImage(iconSize, iconSize, BufferedImage.TYPE_INT_ARGB);
    Graphics2D gr = bi.createGraphics();
    gr.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

    switch (type) {
    case RASTER:
      drawRaster(gr, iconSize, (iconUrl == null ? DEFAULT_RASTER_IMAGE_PATH : iconUrl));
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.