|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--JavaPicture
Field Summary | |
java.awt.image.BufferedImage |
bimg
|
java.awt.Canvas |
canvas
|
javax.swing.ImageIcon |
imgIcon
|
javax.swing.JFrame |
shower
|
Constructor Summary | |
JavaPicture()
|
Method Summary | |
void |
createNewImage(int width,
int height)
|
int |
getBasicPixel(int x,
int y)
Returns the pixel value of a pixel in the picture, given its coordinates. |
int |
getHeight()
|
JavaPixel |
getPixel(int x,
int y)
Returns a JavaPixel object representing a pixel in the picture given its coordinates |
int |
getWidth()
|
void |
JavaPicture()
Constructor |
boolean |
loadImage(java.lang.String filename)
Load image |
static void |
main(java.lang.String[] args)
Test Main |
void |
repaintImage()
|
boolean |
saveImage(java.lang.String newfilename)
Saves the image represented by the JavaPicture object onto disk. |
void |
setBasicPixel(int x,
int y,
int rgb)
Sets the value of a pixel in the picture. |
void |
showPictureWithTitle(java.lang.String s)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.awt.image.BufferedImage bimg
public javax.swing.JFrame shower
public javax.swing.ImageIcon imgIcon
public java.awt.Canvas canvas
Constructor Detail |
public JavaPicture()
Method Detail |
public void JavaPicture()
public int getWidth()
public int getHeight()
public boolean loadImage(java.lang.String filename)
public void createNewImage(int width, int height)
public void repaintImage()
public void showPictureWithTitle(java.lang.String s)
public boolean saveImage(java.lang.String newfilename) throws java.io.IOException
newfilename
- the file name to save to
java.io.IOException
- raised if the save failspublic int getBasicPixel(int x, int y)
x
- the x coordinate of the pixely
- the y coordinate of the pixel
public void setBasicPixel(int x, int y, int rgb)
x
- the x coordinate of the pixely
- the y coordinate of the pixelrgb
- the new rgb value of the pixelpublic JavaPixel getPixel(int x, int y)
x
- the x coordinates of the pixely
- the y coordinates of the pixel
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |