Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1034222 // scaleBufferedImageToFit

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (5049L/28K).

1  
static BufferedImage scaleBufferedImageToFit(int w, int h default w, BufferedImage img) {
2  
  int iw = img.getWidth(), ih = img.getHeight();
3  
  double imgScale = max(doubleRatio(h, ih), doubleRatio(w, iw));
4  
  ret scaleImage(img, imgScale);
5  
}
6  
7  
static BufferedImage scaleBufferedImageToFit(BufferedImage img, int w, int h default w) {
8  
  ret scaleBufferedImageToFit(w, h, img);
9  
}

Author comment

Began life as a copy of #1015057

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034222
Snippet name: scaleBufferedImageToFit
Eternal ID of this version: #1034222/2
Text MD5: 0abb05c82dc9bde0dfa958485896d7ec
Transpilation MD5: ad89bd8e95a20717f18f1fbf2d07e835
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-29 02:38:25
Source code size: 381 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 134 / 211
Version history: 1 change(s)
Referenced in: [show references]