mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
Merge remote-tracking branch 'remotes/origin/GT-2973-dragonmacher-snapshot-navigation-arrows'
This commit is contained in:
commit
6d05537b7f
17 changed files with 768 additions and 402 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue