Jump to content

nashiroaoi

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by nashiroaoi

  1. I changed byte[] data = Files.readAllBytes(event.getScreenshotFile().toPath()); to byte[] data = event.getImage().getBytes(); on my code then it completely worked! Thank you so much!
  2. Hello, I'm making a mod with forge 1.16.3. I want to get screenshot path and read it and change to base64-string. @SubscribeEvent public void onScreenShot(ScreenshotEvent event) throws IOException { byte[] data = Files.readAllBytes(event.getScreenshotFile().toPath()); String base64str = Base64.getEncoder().encodeToString(data); LOGGER.info(base64str); } But it throw java.nio.file.NoSuchFileException: [Screenshotfile.png] and crashed. ScreenShotEvent fired normally so I think that screen shot file is not created yet when event fires but I don't know how should I fix. Could you help me, please?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.