Package NTNU.IDATT1002.utils
Class ImageUtil
java.lang.Object
NTNU.IDATT1002.utils.ImageUtil
public class ImageUtil
extends java.lang.Object
-
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.
-
Constructor Details
-
ImageUtil
public ImageUtil()
-
-
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
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
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
-