import java.awt.geom.AffineTransform; // angle is in our system (clockwise, 0 is north) // rx, ry is rotation point in painted image space static BufferedImage drawRotatedImageOnImage(BufferedImage img, BufferedImage canvas, int x, int y, double angle, double rx, double ry) { Graphics2D g = createGraphics(canvas); g.setTransform(AffineTransform.getRotateInstance(angle*pi()/180, rx, ry)); g.drawImage(img, x, y, null); ret canvas; }
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: | #1015055 | 
| Snippet name: | drawRotatedImageOnImage v1 (no bilinear interpolation) | 
| Eternal ID of this version: | #1015055/1 | 
| Text MD5: | ccd1f9cc60d130a3099fda177ca76983 | 
| 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 15:21:38 | 
| Source code size: | 452 bytes / 10 lines | 
| Pitched / IR pitched: | No / No | 
| Views / Downloads: | 587 / 629 | 
| Referenced in: | -