|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.millscript.datatypes.Image
org.millscript.millscript.datatypes.RasterImage
public final class RasterImage
This class represents a raster image in MillScript.
| Constructor Summary | |
|---|---|
RasterImage(java.awt.image.BufferedImage image)
Constructs a new raster image for the specified buffered image. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
void |
drawLine(int x1,
int y1,
int x2,
int y2)
Draws a line in the current colour, between the points ( x1, y1 ) and ( x2, y2 ). |
void |
drawOval(int x,
int y,
int width,
int height)
Draws the outline of an oval in the current color. |
void |
drawRect(int x,
int y,
int width,
int height)
Draws the outline of a rectangle in the current color. |
void |
drawString(java.lang.String str,
int x,
int y)
Draws the text using the current font, in the current color, at the specified position. |
void |
fillOval(int x,
int y,
int width,
int height)
Draws a filled oval in the current color. |
void |
fillRect(int x,
int y,
int width,
int height)
Draws a filled rectangle in the current color. |
java.awt.Graphics2D |
getGraphics2D()
Returns a Graphics2D object to draw on this image. |
int |
height()
Returns the height of this image, in pixels. |
void |
renderAsRasterToStream(java.io.OutputStream ostream,
ImageRender render)
Renders this image to the specified stream as a raster image. |
void |
setColor(java.awt.Color color)
Sets the current color to the specified value. |
java.lang.String |
toString()
Returns the string representation of this raster image. |
int |
width()
Returns the width of this image, in pixels. |
| Methods inherited from class org.millscript.millscript.datatypes.Image |
|---|
showImage |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RasterImage(java.awt.image.BufferedImage image)
image - the buffered image to wrap as a raster image| Method Detail |
|---|
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class Imagejava.lang.CloneNotSupportedExceptionObject.clone()
public void drawLine(int x1,
int y1,
int x2,
int y2)
Image
drawLine in class Imagex1 - the first point's x coordinatey1 - the first point's y coordinatex2 - the second point's x coordinatey2 - the second point's y coordinateImage.drawLine(int, int, int, int)
public void drawOval(int x,
int y,
int width,
int height)
Imagewidth and height.
drawOval in class Imagex - the starting point x coordinatey - the starting point y coordinatewidth - the width of the rectangle the oval fits inheight - the height of the rectangle the oval fits inImage.drawOval(int, int, int, int)
public void drawRect(int x,
int y,
int width,
int height)
Imagewidth and height.
drawRect in class Imagex - the starting point x coordinatey - the starting point y coordinatewidth - the width of the rectangleheight - the height of the rectangleImage.drawRect(int, int, int, int)
public void drawString(java.lang.String str,
int x,
int y)
Image
drawString in class Imagestr - the string to drawx - the starting point x coordinatey - the starting point y coordinateImage.drawString(java.lang.String, int, int)
public void fillOval(int x,
int y,
int width,
int height)
Imagewidth and height.
fillOval in class Imagex - the starting point x coordinatey - the starting point y coordinatewidth - the width of the rectangle the oval fits inheight - the height of the rectangle the oval fits inImage.fillOval(int, int, int, int)
public void fillRect(int x,
int y,
int width,
int height)
Imagewidth and height.
fillRect in class Imagex - the starting point x coordinatey - the starting point y coordinatewidth - the width of the rectangleheight - the height of the rectangleImage.fillRect(int, int, int, int)public java.awt.Graphics2D getGraphics2D()
Image
getGraphics2D in class ImageImage.getGraphics2D()public int height()
Image
height in class ImageImage.height()
public void renderAsRasterToStream(java.io.OutputStream ostream,
ImageRender render)
throws java.io.IOException
Image
renderAsRasterToStream in class Imageostream - the stream to render torender - the image renderer to use for rasterising the image
java.io.IOException - thrown if problems occur with the streamImage.renderAsRasterToStream(java.io.OutputStream, org.millscript.millscript.render.ImageRender)public void setColor(java.awt.Color color)
Image
setColor in class Imagecolor - the new color to draw inImage.setColor(java.awt.Color)public java.lang.String toString()
toString in class java.lang.Objectpublic int width()
Image
width in class ImageImage.width()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||