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