1 | import java.awt.geom.*; |
2 | |
3 | static void paintSkyBackground(Component c, Graphics _g, BufferedImage image) { |
4 | Graphics2D g = cast _g; |
5 | RenderingHints hints = g.getRenderingHints(); |
6 | antiAliasOn(g); |
7 | int w = c.getWidth(), h = c.getHeight(); |
8 | int iw = image.getWidth(), ih = image.getHeight(); |
9 | g.setColor(c.getBackground()); |
10 | g.fillRect(0, 0, w, h); |
11 | double imgScale = doubleRatio(w, iw); |
12 | AffineTransform before = g.getTransform(); |
13 | double y1 = h-ih*imgScale; |
14 | g.translate(0, y1); |
15 | g.scale(imgScale, imgScale); |
16 | g.drawImage(image, 0, 0, c); |
17 | g.setTransform(before); |
18 | g.setRenderingHints(hints); |
19 | } |
Began life as a copy of #1014537
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: | #1015864 |
Snippet name: | paintSkyBackground |
Eternal ID of this version: | #1015864/6 |
Text MD5: | bfae0ddec819e9d14505514406d9f39f |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-05-29 00:51:31 |
Source code size: | 625 bytes / 19 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 364 / 385 |
Version history: | 5 change(s) |
Referenced in: | [show references] |