Libraryless. Click here for Pure Java version (85L/1K).
static BufferedImage img_addBorder(BufferedImage img, Color color, int border) { int top = border, bottom = border, left = border, right = border; int w = img.getWidth(), h = img.getHeight(); BufferedImage img2 = createBufferedImage(left+w+right, top+h+bottom, color); Graphics2D g = img2.createGraphics(); g.drawImage(img, left, top, null); g.dispose(); ret img2; }
Began life as a copy of #1007135
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1007278 |
| Snippet name: | img_addBorder |
| Eternal ID of this version: | #1007278/2 |
| Text MD5: | 2ff71898326cf70c40aebe89e6b5c30f |
| Transpilation MD5: | b43969dc785ae1d532785aba5e87ab25 |
| Author: | stefan |
| Category: | javax / imaging |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2017-03-14 15:02:55 |
| Source code size: | 388 bytes / 9 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 782 / 896 |
| Version history: | 1 change(s) |
| Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1034776 - PadImageToAspectRatio |