Package bagel
Class Image
java.lang.Object
bagel.Image
Class to load and draw an image.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(double x, double y) Draw the image with its centre at (x, y).voiddraw(double x, double y, DrawOptions options) Draw the image with advanced options as described by anDrawOptionsobject.voiddrawFromTopLeft(double x, double y) Draw the image with its top-left at (x, y).voiddrawFromTopLeft(double x, double y, DrawOptions options) Draw the image with its top-left at (x, y) with extra options.Creates aRectangleas defined by this image, located with its top-left at (0, 0).getBoundingBoxAt(Point point) doubleReturns the height of the image in pixels.doublegetWidth()Returns the width of the image in pixels.
-
Constructor Details
-
Image
Load an image from a file.- Parameters:
filename- the filename to load
-
-
Method Details
-
drawFromTopLeft
public void drawFromTopLeft(double x, double y) Draw the image with its top-left at (x, y). -
drawFromTopLeft
Draw the image with its top-left at (x, y) with extra options. -
draw
public void draw(double x, double y) Draw the image with its centre at (x, y). -
draw
Draw the image with advanced options as described by anDrawOptionsobject. -
getWidth
public double getWidth()Returns the width of the image in pixels. -
getHeight
public double getHeight()Returns the height of the image in pixels. -
getBoundingBox
Creates aRectangleas defined by this image, located with its top-left at (0, 0). -
getBoundingBoxAt
-