1
我想获得BufferedImage
的子图像,然后使用此子图像替换原始的BufferedImage
,以实现基于用户指定选择的缩放功能。但是,当我将subImage重绘到原始图像上时,子图像的底部未显示。我不知道为什么。我想知道是否有人可以发现任何明显的缺点!?!放大BufferedImage的特定部分
private void zoomImage(int x1, int x2, int y1, int y2){
BufferedImage subImage = originalImage.getSubimage(x1, y1, x2-x1, y2-y1);
Graphics2D graphics2D = (Graphics2D) originalImage.getGraphics();
graphics2D.drawImage(subImage, 0, 0, 600, 400, 0,0, x2-x1,y2-y1, null);
// clean up
graphics2D.dispose();
}
我也想知道是否有实现在特定矩形选区放大和使用部分放大取代原来的图像更好的办法。