1
私はBufferedImagesのサイズを変更する方法を書いていましたが、その後に.pngイメージが透明になり、代わりに黒い背景が表示されます。サイズ変更後に黒い背景を削除する方法
public BufferedImage getSizedImg(BufferedImage otherImage,int width,int height){
BufferedImage outputImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics g = outputImg.createGraphics();
g.drawImage(otherImage, 0, 0, width, height, null);
g.dispose();
return outputImg;
}
どのように画像を透明に保つようにこのメソッドを修正できますか?