static BufferedImage addRandomSizedBorder(BufferedImage img) { int top = random(20), bottom = random(20), left = random(20), right = random(20); int w = img.getWidth(), h = img.getHeight(); BufferedImage img2 = createBufferedImage(left+w+right, top+h+bottom, Color.white); Graphics2D g = img2.createGraphics(); g.drawImage(img, left, top, null); g.dispose(); ret img2; }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1007135 |
Snippet name: | addRandomSizedBorder |
Eternal ID of this version: | #1007135/2 |
Text MD5: | 9ed2ff95cf27720d2d354afb66d8c9fe |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-03-05 23:50:16 |
Source code size: | 392 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 489 / 523 |
Version history: | 1 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1007278 - img_addBorder |