Class ImageUtil

java.lang.Object
NTNU.IDATT1002.utils.ImageUtil

public class ImageUtil
extends java.lang.Object
Image Util class for performing Image related utility operations, such as converting a file to a byte array and Image to Image.
  • Constructor Summary

    Constructors 
    Constructor Description
    ImageUtil()  
  • Method Summary

    Modifier and Type Method Description
    static byte[] convertToBytes​(java.lang.String path)
    Convert the file on the given path to a byte array.
    static javafx.scene.image.Image convertToFXImage​(Image image)
    Convert the given domain image to a javafx image which can be displayed by a controller.
    static java.lang.String createSmallerMarkers​(Image image)
    Resizes and image to be suitable as markers on map.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • convertToBytes

      public static byte[] convertToBytes​(java.lang.String path)
      Convert the file on the given path to a byte array.
      Parameters:
      path - the path to the file to be converted
      Returns:
      the file, represented as a byte array
    • convertToFXImage

      public static javafx.scene.image.Image convertToFXImage​(Image image)
      Convert the given domain image to a javafx image which can be displayed by a controller.
      Parameters:
      image - the image to convert
      Returns:
      the converted image.
    • createSmallerMarkers

      public static java.lang.String createSmallerMarkers​(Image image)
      Resizes and image to be suitable as markers on map.
      Parameters:
      image - that will be resized
      Returns:
      string with resized image in HTML img format