Java Draw Image drawBoundingPolygon(BufferedImage canvas, Polygon p, Color fgColour)

Here you can find the source of drawBoundingPolygon(BufferedImage canvas, Polygon p, Color fgColour)

Description

draw Bounding Polygon

License

Open Source License

Declaration

public static BufferedImage drawBoundingPolygon(BufferedImage canvas,
            Polygon p, Color fgColour) 

Method Source Code

//package com.java2s;
/*****************************************************************************
 ** ANGRYBIRDS AI AGENT FRAMEWORK//  ww  w  .  j  a v a2 s  .  c om
 ** Copyright (c) 2013,XiaoYu (Gary) Ge, Stephen Gould,Jochen Renz
 **  Sahan Abeyasinghe, Jim Keys, Kar-Wai Lim, Zain Mubashir,  Andrew Wang, Peng Zhang
 ** All rights reserved.
 **This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. 
 **To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ 
 *or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
 *****************************************************************************/

import java.awt.Color;

import java.awt.Graphics2D;

import java.awt.Polygon;

import java.awt.image.BufferedImage;

public class Main {
    public static BufferedImage drawBoundingPolygon(BufferedImage canvas,
            Polygon p, Color fgColour) {
        Graphics2D g2d = canvas.createGraphics();
        g2d.setColor(fgColour);
        g2d.drawPolygon(p);
        return canvas;
    }
}

Related

  1. draw4on1(BufferedImage[] src, BufferedImage dst)
  2. draw9Patch(BufferedImage image, Integer[] patches, float ratio)
  3. drawBorder(BufferedImage buffImage)
  4. drawBorder(BufferedImage originalImage, Color borderColor, int borderWidth)
  5. 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)
  6. drawBubble(BufferedImage img, Graphics g, Component component)
  7. drawBytes(BufferedImage image, byte[] buf)
  8. drawCenterCrop(Graphics2D g, BufferedImage source, Rectangle dstRect)
  9. drawCenteredImage(Rectangle2D bounds, Graphics2D g2, Image image, ImageObserver observer, int imageWidth, int imageHeight, boolean shrink)