Examples of createGraphics()


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

                    w,
                    h,
                    imageType);
        } else {
            BufferedImage bufferedImage = new BufferedImage(w, h, imageType);
            Graphics2D g2d = bufferedImage.createGraphics();
            g2d.drawImage(image, x, y, null);
            g2d.dispose();
            return bufferedImage;
        }
    }
View Full Code Here

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

                    }
                }
            }

            BufferedImage bi = new BufferedImage(8, 8, BufferedImage.TYPE_INT_ARGB);
            Graphics2D big = bi.createGraphics();
            big.setColor(new Color(0, true)); // clear
            big.fillRect(0, 0, 8, 8);
            big.setPaint(fillPaint);

            if (fillPatternString.equalsIgnoreCase(LPC_HORIZONTAL_PATTERN)) {
View Full Code Here

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

            if (h > height) {
                h /= 2;
                if (h < height) h = height;
            }
            BufferedImage tmp = new BufferedImage(w, h, type);
            Graphics2D g2 = tmp.createGraphics();
            g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
            g2.drawImage(ret, 0, 0, w, h, null);
            g2.dispose();
            ret = tmp;
        }
View Full Code Here

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

        w = targetWidth;
        h = targetHeight;
      }

      final BufferedImage tmp = new BufferedImage(w, h, type);
      final Graphics2D g2 = tmp.createGraphics();
      g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, hintValue);
      // this one scales the image ..
      if (ret instanceof BufferedImage)
      {
        if (g2.drawImage(ret, 0, 0, w, h, null) == false)
View Full Code Here

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

        int width = 200;
        int height = 200;
        int imageType = BufferedImage.TYPE_INT_ARGB;
        BufferedImage bufferedImage = new BufferedImage(width, height, imageType);
        Graphics2D g2d = bufferedImage.createGraphics();
        g2d.setClip(0, 0, width, height);
        g2d.setColor(Color.red);
        g2d.drawLine(10, 10, 95, 95);
        g2d.drawLine(105, 105, 190, 190);
        g2d.drawRect(1, 1, 198, 198);
View Full Code Here

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

            throws com.bbn.openmap.io.FormatException, IOException {
        int width = 200;
        int height = 200;
        int imageType = BufferedImage.TYPE_INT_ARGB;
        BufferedImage bufferedImage = new BufferedImage(width, height, imageType);
        Graphics2D g2d = bufferedImage.createGraphics();
        g2d.setClip(0, 0, width, height);
        g2d.setColor(Color.red);
        g2d.drawLine(10, 10, 95, 95);
        g2d.drawLine(105, 105, 190, 190);
        g2d.drawRect(1, 1, 198, 198);
View Full Code Here

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

            if (h > height) {
                h /= 2;
                if (h < height) h = height;
            }
            BufferedImage tmp = new BufferedImage(w, h, type);
            Graphics2D g2 = tmp.createGraphics();
            g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
            g2.drawImage(ret, 0, 0, w, h, null);
            g2.dispose();
            ret.flush();
            ret = tmp;
View Full Code Here

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

    if (f !=null){
      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();

      if (c!=null)
        g2.setColor(c);
      else
        g2.setColor(Color.WHITE);
View Full Code Here

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

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

   
    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
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.