1 | static BufferedImage renderShape(Color bg default Color.white, Shape shape, int w, int h) { |
2 | BufferedImage img = newBufferedImage(w, h, bg); |
3 | Graphics2D g = img.createGraphics(); |
4 | g.setColor(Color.black); |
5 | g.fill(shape); |
6 | ret img; |
7 | } |
8 | |
9 | static BufferedImage renderShape(Color bg default Color.white, Shape shape, Rect bounds) { |
10 | BufferedImage img = newBufferedImage(bounds.w, bounds.h, bg); |
11 | Graphics2D g = img.createGraphics(); |
12 | g.translate(-bounds.x, -bounds.y); |
13 | g.setColor(Color.black); |
14 | g.fill(shape); |
15 | ret img; |
16 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1006979 |
Snippet name: | renderShape |
Eternal ID of this version: | #1006979/5 |
Text MD5: | 4e27b36ec2543d9d426809658be4cc5c |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-04-28 17:29:20 |
Source code size: | 541 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 474 / 566 |
Version history: | 4 change(s) |
Referenced in: | [show references] |