Merge remote-tracking branch 'remotes/origin/GT-2973-dragonmacher-snapshot-navigation-arrows'

This commit is contained in:
Ryan Kurtz 2019-07-19 09:28:36 -04:00
commit 6d05537b7f
17 changed files with 768 additions and 402 deletions

View file

@ -41,6 +41,26 @@ public class ImageUtils {
// no
}
/**
* Creates an image of the given component
*
* @param c the component
* @return the image
*/
public static Image createImage(Component c) {
// prevent this from being called when the user has made the window too small to work
Rectangle bounds = c.getBounds();
int w = Math.max(bounds.width, 1);
int h = Math.max(bounds.height, 1);
BufferedImage bufferedImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
Graphics g = bufferedImage.getGraphics();
c.paint(g);
g.dispose();
return bufferedImage;
}
/**
* Pads the given image with space in the amount given.
*