Libraryless. Click here for Pure Java version (4610L/26K).
static Image resizeImage_raw(Image img, int newW, int newH) { ret resizeImage_raw(img, newW, newH, Image.SCALE_SMOOTH); } static Image resizeImage_raw(Image img, int newW, int newH, int scaleType) { if (newW == img.getWidth(null) && newH == img.getHeight(null)) ret img; ret img.getScaledInstance(newW, newH, scaleType); } static Image resizeImage_raw(Image img, int newW) { int newH = iround(img.getHeight(null)*(double) newW/img.getWidth(null)); ret resizeImage_raw(img, newW, newH); } static Image resizeImage_raw(int newW, Image img) { ret resizeImage_raw(img, newW); }
Began life as a copy of #1004224
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033899 |
Snippet name: | resizeImage_raw - preserves transparency, defaults to smooth scaling |
Eternal ID of this version: | #1033899/5 |
Text MD5: | 1ccca00195a30cb6ed721c944a944887 |
Transpilation MD5: | 95f4596996062f6ac9bdb6a1745b0fac |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-01-09 19:17:59 |
Source code size: | 604 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 171 / 234 |
Version history: | 4 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |