1 | // angle is in degrees (clockwise, 0 is north, 360 is full rotation) |
2 | // uses white background |
3 | static BufferedImage rotateImageInSameSize(BufferedImage img, double angle) { |
4 | int w = img.getWidth(), h = img.getHeight(); |
5 | BufferedImage canvas = newBufferedImage(w, h, Color.white); |
6 | drawRotatedImageOnImage(img, canvas, 0, 0, angle, w/2, h/2); |
7 | ret canvas; |
8 | } |
Began life as a copy of #1015053
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: | #1015056 |
Snippet name: | rotateImageInSameSize |
Eternal ID of this version: | #1015056/5 |
Text MD5: | b4b56ef2ac40a88f9d3f47c0fca8b50b |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-08-03 17:28:26 |
Source code size: | 366 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 435 / 463 |
Version history: | 4 change(s) |
Referenced in: | [show references] |