Draw image as a polygon

此生再无相见时 提交于 2020-02-07 03:38:25

问题


I'm trying to draw an image as a polygon in Swing but I don't know how. Now I only have code to draw filled polygon. This is not a cropped image, it is distorted.

What I need (Polygon with texture):

What I have - Filled polygon

gr.fillPolygon(x_points, y_points, points.length);

回答1:


The easiest way to render 3D is using JOGL library which uses OpenGL to render in JPanel.



来源:https://stackoverflow.com/questions/55949306/draw-image-as-a-polygon

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