How to crop a polygon from BufferedImage

三世轮回 提交于 2019-12-25 14:22:10

问题


How to crop a polygon shaped portion of BufferedImage and write it to another BufferedImage?


回答1:


Graphics2D has clip(Shape) and draw(Shape) methods. So I would guess you can set the Shape to be your polygon and then paint from one BufferedImage to the other.



来源:https://stackoverflow.com/questions/4997473/how-to-crop-a-polygon-from-bufferedimage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!