Java Draw Image drawBubble(BufferedImage img, Graphics g, Component component)

Here you can find the source of drawBubble(BufferedImage img, Graphics g, Component component)

Description

draw Bubble

License

Apache License

Declaration

public static void drawBubble(BufferedImage img, Graphics g, Component component) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.awt.Component;
import java.awt.Graphics;

import java.awt.image.BufferedImage;

public class Main {
    public static void drawBubble(BufferedImage img, Graphics g, Component component) {
        // header
        g.drawImage(img.getSubimage(0, 0, 31, 31), 0, 0, 14, 14, null);
        g.drawImage(img.getSubimage(31, 0, 10, 31), 14, 0, component.getWidth() - 14 - 14, 14, null);
        g.drawImage(img.getSubimage(img.getWidth() - 31, 0, 31, 31), component.getWidth() - 14, 0, 14, 14, null);
        // body//from  ww w  .j  a  v a 2  s  . c  om
        g.drawImage(img.getSubimage(0, 31, 31, img.getHeight() - 31 - 25), 0, 14, 14,
                component.getHeight() - 14 - 14, null);
        g.drawImage(img.getSubimage(31, 31, 5, img.getHeight() - 31 - 25), 14, 14, component.getWidth() - 14 - 14,
                component.getHeight() - 14 - 14, null);
        g.drawImage(img.getSubimage(img.getWidth() - 25, 31, 25, img.getHeight() - 31 - 25),
                component.getWidth() - 14, 14, 14, component.getHeight() - 14 - 14, null);
        // footer
        g.drawImage(img.getSubimage(0, img.getHeight() - 25, 33, 25), 0, component.getHeight() - 14, 14, 14, null);
        g.drawImage(img.getSubimage(40, img.getHeight() - 25, 5, 25), 14, component.getHeight() - 14,
                component.getWidth() - 14 - 14, 14, null);
        g.drawImage(img.getSubimage(img.getWidth() - 28, img.getHeight() - 28, 28, 28), component.getWidth() - 14,
                component.getHeight() - 14, 14, 14, null);
    }
}

Related

  1. draw9Patch(BufferedImage image, Integer[] patches, float ratio)
  2. drawBorder(BufferedImage buffImage)
  3. drawBorder(BufferedImage originalImage, Color borderColor, int borderWidth)
  4. drawBorders(final BufferedImage image, final int currentX, final int currentY, final int width, final int height, final int subImageWidth, final int subImageHeight, final Color c)
  5. drawBoundingPolygon(BufferedImage canvas, Polygon p, Color fgColour)
  6. drawBytes(BufferedImage image, byte[] buf)
  7. drawCenterCrop(Graphics2D g, BufferedImage source, Rectangle dstRect)
  8. drawCenteredImage(Rectangle2D bounds, Graphics2D g2, Image image, ImageObserver observer, int imageWidth, int imageHeight, boolean shrink)
  9. DrawCross(BufferedImage bi, Point pt)