2
我需要使用image.setCorners()
倾斜图像,这可以使用JavaXT库来完成。 但是我有BufferedImage
窗体中的图像,而不是保存的文件。如何将BufferedImage转换为javaxt.io.Image?
那么如何将BufferedImage
转换为javaxt.io.Image
,以便我可以对其执行偏移操作。
这里是我使用的扭曲图像的代码:
javaxt.io.Image image = new javaxt.io.Image("image1.jpg");
System.out.println(image.getWidth() + "x" + image.getHeight());
int width = image.getWidth();
int height = image.getHeight();
image.setCorners(0, 0, //UL
width, 10, //UR
width, height-10, //LR
0, height); //LL