解决Graphics2D drawImage图片失真的问题

####常规的写法

graphics.drawImage(originalBufferedImage, rectangle.x,
rectangle.y,
rectangle.width, rectangle.height, null);

####优化的写法

graphics.drawImage(
originalBufferedImage.getScaledInstance(rectangle.width,
rectangle.height, Image.SCALE_SMOOTH),
rectangle.x, rectangle.y, null);

更多精彩,敬请关注, 程序员导航网 https://chenzhuofan.top

解决Graphics2D drawImage图片失真的问题_第1张图片

你可能感兴趣的:(java)