public class Image extends Shape
DEFAULT_COLOR
Constructor and Description |
---|
Image(double x,
double y,
java.lang.String filename)
Creates an image from the given file centered at the given coordinates.
|
Image(Point cen,
java.lang.String name)
Creates an image from the given file centered at the given point.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Point point)
Determines if this image contains the given point.
|
void |
draw(android.graphics.Canvas canvas)
Draws this image on the given canvas.
|
Point |
getCenter()
Returns the center of this image.
|
int |
getHeight()
Returns the height of this image.
|
java.lang.String |
getName()
Returns the file name of this image.
|
int |
getWidth()
Returns the width of this image.
|
void |
move(double dx,
double dy)
Moves this image by the given displacement.
|
public Image(double x, double y, java.lang.String filename)
x
- the x-coordinate of the image centery
- the y-coordinate of the image centerfilename
- the name of the file with the imagepublic Image(Point cen, java.lang.String name)
cen
- the center of the imagename
- the name of the file with the imagepublic boolean contains(Point point)
public void draw(android.graphics.Canvas canvas)
public Point getCenter()
public int getHeight()
public java.lang.String getName()
public int getWidth()