开发者

get rid of some parts of png in java

In my program,I am producing a png from a panel,but I want to get rid of the bounding box of this panel and to开发者_JS百科 be more focused to the object in the panel.To do so, I want to get rid of the peripheral parts of png, and produce only the center of it.How can i do that ?


Assuming that you already have your image loaded into a BufferedImage (which seems to be the case), this code will crop the image from (x,y) to (width,height).

image = image.getSubimage(x, y, width, height);

Then save as normal.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜