Class BrickImage

java.lang.Object
com.example.brickpaint.BrickImage

public abstract class BrickImage extends Object
Handles common image functions for javaFX applications
Author:
matde
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static javafx.scene.image.WritableImage
    getScaledImage(javafx.scene.canvas.Canvas canvas)
    Gets a writable image of the provided canvas's content
    static void
    Insert(CanvasPanel panel, javafx.scene.image.Image image)
    Adds an image to an imageView component in javaFX, scales imageView to the size of input image
    static void
    Paste(CanvasPanel panel, javafx.scene.image.Image image)
    Adds an image to a Canvas component in javaFX at the point (0,0)
    static void
    Paste(CanvasPanel panel, javafx.scene.image.Image image, javafx.geometry.Point2D point)
    Adds an image to a Canvas component in javaFX at a specified position
    static void
    PasteRotate(CanvasPanel panel, javafx.scene.image.Image image, javafx.geometry.Point2D point)
    Adds an image to a Canvas component in javaFX at a specified position and rescales the canvas if needed
    static void
    render(javafx.scene.image.WritableImage image, javafx.scene.canvas.Canvas canvas, int sx, int sy, int sw, int sh, int tx, int ty)
    Will render a writable image to the provided canvas

    Methods inherited from class java.lang.Object

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

    • BrickImage

      public BrickImage()
  • Method Details

    • Insert

      public static void Insert(CanvasPanel panel, javafx.scene.image.Image image)
      Adds an image to an imageView component in javaFX, scales imageView to the size of input image
      Parameters:
      image - The image to insert into the canvas
      panel - The CanvasPanel Class to add the image to
    • Paste

      public static void Paste(CanvasPanel panel, javafx.scene.image.Image image, javafx.geometry.Point2D point)
      Adds an image to a Canvas component in javaFX at a specified position
      Parameters:
      image - The image to insert into the canvas
      panel - The CanvasPanel Class to add the image to
      point - the location of the top left of the image
    • Paste

      public static void Paste(CanvasPanel panel, javafx.scene.image.Image image)
      Adds an image to a Canvas component in javaFX at the point (0,0)
      Parameters:
      image - The image to insert into the canvas
      panel - The CanvasPanel Class to add the image to
    • PasteRotate

      public static void PasteRotate(CanvasPanel panel, javafx.scene.image.Image image, javafx.geometry.Point2D point)
      Adds an image to a Canvas component in javaFX at a specified position and rescales the canvas if needed
      Parameters:
      image - The image to insert into the canvas
      panel - The CanvasPanel Class to add the image to
      point - the location of the top left of the image
    • render

      public static void render(javafx.scene.image.WritableImage image, javafx.scene.canvas.Canvas canvas, int sx, int sy, int sw, int sh, int tx, int ty)
      Will render a writable image to the provided canvas
      Parameters:
      image - Image to render
      canvas - Canvas to render the image to
      sx - Top left source image x position
      sy - Top left source image y position
      sw - Source image width
      sh - Source image height
      tx - The x position to draw the image at
      ty - The y position to draw the image at
    • getScaledImage

      public static javafx.scene.image.WritableImage getScaledImage(javafx.scene.canvas.Canvas canvas)
      Gets a writable image of the provided canvas's content
      Parameters:
      canvas - The canvas to create an image from
      Returns:
      WritableImage of the provided canvas