Package java.awt

Examples of java.awt.Graphics2D.drawImage()


        }

        if (savdest != null) {
            Graphics2D big = savdest.createGraphics();
      try {
          big.drawImage(dest, 0, 0, null);
      } finally {
          big.dispose();
      }
            return savdest;
        } else {
View Full Code Here


                }
            }
            if (noTrans) {
                Graphics2D g = dest.createGraphics();
                try {
                    g.drawImage(src, 0, 0, null);
                } finally {
                    g.dispose();
                }

                return dest;
View Full Code Here

        try {
            Robot robot = new Robot(getGraphicsConfiguration().getDevice());
            BufferedImage capture = robot.createScreenCapture(new Rectangle(
                    windowRect.x, windowRect.y, windowRect.width + extra,
                    windowRect.height + extra));
            g2.drawImage(capture, null, 0, 0);
        } catch (AWTException e) {
        }

        BufferedImage shadow = new BufferedImage(width + extra, height + extra,
                BufferedImage.TYPE_INT_ARGB);
View Full Code Here

                BufferedImage.TYPE_INT_ARGB);
        Graphics g = shadow.getGraphics();
        g.setColor(new Color(0.0f, 0.0f, 0.0f, 0.3f));
        g.fillRoundRect(6, 6, width, height, 12, 12);

        g2.drawImage(shadow, getBlurOp(7), 0, 0);
        g2.drawImage(image, 0, 0, this);
    }

    private ConvolveOp getBlurOp(int size) {
        float[] data = new float[size * size];
 
View Full Code Here

        Graphics g = shadow.getGraphics();
        g.setColor(new Color(0.0f, 0.0f, 0.0f, 0.3f));
        g.fillRoundRect(6, 6, width, height, 12, 12);

        g2.drawImage(shadow, getBlurOp(7), 0, 0);
        g2.drawImage(image, 0, 0, this);
    }

    private ConvolveOp getBlurOp(int size) {
        float[] data = new float[size * size];
        float value = 1 / (float) (size * size);
 
View Full Code Here

            }
            //
            // Now paint the BufferedImage into the accelerated image
            //
            Graphics2D g = volatileImage.createGraphics();
            g.drawImage(bufferedImage, 0, 0, null);
            g.dispose();
        } while (volatileImage.contentsLost());
    }
   
    /**
 
View Full Code Here

      case SwingConstants.HORIZONTAL:
      default:
        image = horizIcon.getImage();
    }

    g2d.drawImage(image, thumbRect.x, thumbRect.y, thumbRect.width, thumbRect.height, null);
  }
 
  public void paintTrack(Graphics g) {
//    super.paintTrack(g);
   
View Full Code Here

    // opacity
    log.debug("before drawImage");
    // create a copy to apply transform
    Graphics2D g = (Graphics2D) graphics.create();
    g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, getOpacity()));
    g.drawImage(image, transform, null);
    log.debug("after drawImage");
  }

  private float getOpacity() {
    String match = style;
View Full Code Here

  }
 
  private static BufferedImage toBufferedImage(Image image, int w, int h, int type) {
    BufferedImage result = new BufferedImage(w, h, type);
    Graphics2D g = result.createGraphics();
    g.drawImage(image, 0, 0, null);
    g.dispose();
    return result;
  }
 
  public static final class Size {
View Full Code Here

      int width, int height) {
    int type = (image.getTransparency() == Transparency.OPAQUE) ? BufferedImage.TYPE_INT_RGB
        : BufferedImage.TYPE_INT_ARGB;
    BufferedImage result = new BufferedImage(width, height, type);
    Graphics2D graphics = result.createGraphics();
    graphics.drawImage(
        image.getScaledInstance(width, height, Image.SCALE_SMOOTH), 0,
        0, width, height, null);
    graphics.dispose();
    return result;
  }
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.