static BufferedImage imageToBufferedImage(Image img) { if (img == null || img instanceof BufferedImage) ret (BufferedImage) img; BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB); bimage.createGraphics().drawImage(img, 0, 0, null); ret bimage; }
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: | #1015072 |
Snippet name: | imageToBufferedImage - preserves transparency |
Eternal ID of this version: | #1015072/4 |
Text MD5: | eb54060963c98b0587a63aeb98aacd95 |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-05-07 18:52:53 |
Source code size: | 319 bytes / 6 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 389 / 423 |
Version history: | 3 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |