1 | static BufferedImage imageToBufferedImage(Image img) { |
2 | if (img == null || img instanceof BufferedImage) ret (BufferedImage) img; |
3 | BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB); |
4 | bimage.createGraphics().drawImage(img, 0, 0, null); |
5 | ret bimage; |
6 | } |
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: | 388 / 422 |
Version history: | 3 change(s) |
Referenced in: | [show references] |