1 | static BufferedImage addRandomSizedBorder(BufferedImage img) { |
2 | int top = random(20), bottom = random(20), left = random(20), right = random(20); |
3 | int w = img.getWidth(), h = img.getHeight(); |
4 | BufferedImage img2 = createBufferedImage(left+w+right, top+h+bottom, Color.white); |
5 | Graphics2D g = img2.createGraphics(); |
6 | g.drawImage(img, left, top, null); |
7 | g.dispose(); |
8 | ret img2; |
9 | } |
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: | 488 / 522 |
Version history: | 1 change(s) |
Referenced in: | [show references] |