Libraryless. Click here for Pure Java version (4934L/27K).
1 | static int heightForWidth(int w, int h, int newWidth) { |
2 | ret iround(newWidth*doubleRatio(h, w)); |
3 | } |
4 | |
5 | static int heightForWidth(BufferedImage img, int newWidth) { |
6 | ret heightForWidth(img.getWidth(), img.getHeight(), newWidth); |
7 | } |
8 | |
9 | static int heightForWidth(int newWidth, BufferedImage img) { |
10 | ret heightForWidth(img, newWidth); |
11 | } |
12 | |
13 | static int heightForWidth(WidthAndHeight img, int newWidth) { |
14 | ret heightForWidth(img.getWidth(), img.getHeight(), newWidth); |
15 | } |
Began life as a copy of #1031934
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
Snippet ID: | #1031963 |
Snippet name: | heightForWidth |
Eternal ID of this version: | #1031963/3 |
Text MD5: | 89b9e3536f8f32df37b5e33cf9cdd482 |
Transpilation MD5: | 2459f0e1c79cd85b8b458dc2858d99a6 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-12-26 18:38:48 |
Source code size: | 477 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 193 / 313 |
Version history: | 2 change(s) |
Referenced in: | [show references] |