Recently I've been porting my code from Android Java to Java. Apart from a number of APIs, much of the code remain the same. And I got solutions to several APIs by checking the docs or googling. But one Android APIs to Java still eludes me
Creating a scaled bitmap (BufferedImage) in Java
The exact (remaining) Android scaling functionality I need to port to Java is this
myBitmap = Bitmap.createScaledBitmap( originalBitmap, 480, 800, false ); What I could find for Java is the code below (the first loads image but doesn't allow parameters to scale to different height and width and the second creates new image but doesn't scale an existing bufferedImage )
myBitmap = ImageIO.read(new File( filePath + filename ));
AND
myBitmap = new BufferedImage(480, 800, BufferedImage.TYPE_INT_RGB);
//(which is not scaling an existing image) How can I set size (w,h) parameters to scale an existing bitmap to different dimensions? I guess its out there somewhere but I'm just missing it. Couldn't find it in this doc drop-down or am I looking in the wrong place
[attachment=35871:java bitmaps.jpg]