I want to crop image like below.
+------------------+
| |
| +-----------+ |
| | | |
| | | |
| | | |
| | | |
| +-----------+ |
| |
+------------------+
style="width: 413px; height: 296px; margin-left: -134px; margin-top: -67px;"
var height = ele.css('height');
var width = ele.css('width');
var margin_left = ele.css('margin-left');
var margin_top = ele.css('margin-top');
我不知道该怎么做才能得到裁剪的图像?
final int totalheight = image.getHeight(); //1900
final int totalwidth = image.getWidth(); //2533
image.getSubimage(totalheight+Integer.valueOf(margintop).intValue(), totalwidth+Integer.valueOf(marginleft).intValue(), Integer.valueOf(width).intValue(),Integer.valueOf(height).intValue());
java.awt.image.RasterFormatException: (y + height) is outside of Raster
at sun.awt.image.ByteInterleavedRaster.createWritableChild(Unknown Source)
at java.awt.image.BufferedImage.getSubimage(Unknown Source)