|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MinuetoDrawingSurface
This interface denotes an object which can be drawn to with images or lines
As well as having a width and height, pxels can be accessed or set
It is also possible to save the image to a file.
This interface was created to solidy the similarities between a MinuetoWindow
and a MinuetoImage
MinuetoImage,
MinuetoBaseWindow| Method Summary | |
|---|---|
void |
clear()
Clears the contents of the Drawing Surface. |
void |
clear(MinuetoColor color)
Erases the contents from the Drawing Surface. |
void |
draw(MinuetoImage image,
int x,
int y)
Draw another MinuetoImage on this MinuetoDrawingSurface (thus compositing them). |
void |
drawLine(MinuetoColor color,
int xStart,
int yStart,
int xStop,
int yStop)
Draw a line of the specified color from the start point to the end point. |
int |
getHeight()
Return the height of the image. |
int |
getWidth()
Return the width of the image. |
void |
save(java.lang.String filename)
Saves the content of the MinuetoDrawingSurface to a PNG file. |
void |
setPixel(int x,
int y,
MinuetoColor color)
Change the color of pxel at location X,y. |
| Method Detail |
|---|
void clear()
void clear(MinuetoColor color)
color - MinuetoColor of the cleared buffer.
void setPixel(int x,
int y,
MinuetoColor color)
This uses the drawLine function to be faster than a direct raw data setPxel, though it should be used with caution as it is still slower than drawing a completed image to the drawing surface.
x - int denoting which pxel on the X axis should be colored.y - int denoting which pxel on the y axis should be colored.color - MinuetoColor denoting the new color for pxel x,y.
void draw(MinuetoImage image,
int x,
int y)
MinuetoImage on this MinuetoDrawingSurface (thus compositing them).
image - MinuetoImage that we will draw on our image.x - int denoting where we should start drawing on the x axis.y - int denothing where we should start drawing on the y axis.
void drawLine(MinuetoColor color,
int xStart,
int yStart,
int xStop,
int yStop)
color - MinuetoColor denoting the color of the line.xStart - int denoting the X value of the start point.yStart - int denoting the Y value of the start point.xStop - int denoting the X value of the end point.yStop - int denoting the Y value of the end point.
MinuetoOutOfBoundException - if the target coordinates are not
valid.int getWidth()
int denoting the width of the image.int getHeight()
int denoting the height of the image.
void save(java.lang.String filename)
throws MinuetoFileException
filename - String indicating the name of the PNG file.
MinuetoFileException - if it cannot write the file.
MinuetoFileException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||