I can obtain the size and original data of the grayscale image through the API, but I have not found a suitable method to store these data as pictures.
I tried using BufferedImage to handle it but don't know how to transfer the contents stored with the array into BufferedImage.
byte[] buffer = API.readGrayScaleImageRawData();
BufferedImage bufferedImage = new BufferedImage(width, length, BufferedImage.TYPE_BYTE_GRAY);
//TODO: how to transfer the content from buffer to bufferedImage