Package dataPlotsFX

Class FXIconLoder

java.lang.Object
dataPlotsFX.FXIconLoder

public class FXIconLoder extends Object
Utility functions to load image files into Canvases to use as icons in displays, etc. Typical usage is icon = FXIconLoder.createIcon("Resources/BeamformIcon20.png", 20, 20);
Author:
dg50
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static javafx.scene.canvas.Canvas
    createIcon(String imageResource)
    Create an icon the same size as the original image, no scaling.
    static javafx.scene.canvas.Canvas
    createIcon(String imageResource, int width, int height)
    Create a canvas with the image scaled / squashed / stretched to a set size.
    static javafx.scene.image.Image
    createImage(String imageResource)
    Create a image from a resource .

    Methods inherited from class java.lang.Object

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

    • FXIconLoder

      public FXIconLoder()
  • Method Details

    • createIcon

      public static javafx.scene.canvas.Canvas createIcon(String imageResource)
      Create an icon the same size as the original image, no scaling.
      Parameters:
      imageResource - Image resource
      Returns:
      Canvas of the same size as the image.
    • createIcon

      public static javafx.scene.canvas.Canvas createIcon(String imageResource, int width, int height)
      Create a canvas with the image scaled / squashed / stretched to a set size.
      Parameters:
      imageResource - Image resource
      width - required width after scaling
      height - required height after scaling
      Returns:
      Canvas of the determined size.
    • createImage

      public static javafx.scene.image.Image createImage(String imageResource)
      Create a image from a resource .
      Parameters:
      imageResource - Image resource
      Returns:
      Canvas of the determined size.