|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectimg.DigitalPicture
img.PictureX
public class PictureX
This class encapsulates a picture. A picture has a width and a height (given in pixels). The number of pixels in the picture is determined by the width and height of the picture. This class is based on the Picture class from Guzdial and Ericson, with explanatory comments and modifications provided by various contributors: sdc@cs.albany.edu, ericson@cc.gatech.edu. mb@cse.yorku.ca This class extends SimplePicture (which provisions for the addition of specific functionality)
Constructor Summary | |
---|---|
PictureX()
Default constructor. |
|
PictureX(int width,
int height)
Constructs a picture with the width and height as specified by the passed parameter values. |
|
PictureX(PictureX copyPicture)
Constructs a picture that is a copy of the specified picture. |
|
PictureX(java.lang.String fileName)
Constructs a picture from the filename that is passed as parameter. |
Method Summary | |
---|---|
void |
blacken(int row)
The method causes all of the pixels in the specified row to be changed to a black colour. |
java.lang.String |
toString()
Return a string representation of this Picture. |
Methods inherited from class img.DigitalPicture |
---|
addMessage, copyPicture, createGraphics, explore, getBasicPixel, getBufferedImage, getExtension, getFileName, getGraphics, getGraphics2D, getHeight, getImage, getPictureFrame, getPictureWithHeight, getPixel, getPixels, getTitle, getTranslationEnclosingRectangle, getWidth, load, load, loadPictureAndShowIt, repaint, setAllPixelsToAColor, setBasicPixel, setPictureFrame, setTitle, show, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PictureX()
public PictureX(java.lang.String fileName)
fileName
- the name of the file to create the picture frompublic PictureX(int width, int height)
width
- the width of the desired pictureheight
- the height of the desired picturepublic PictureX(PictureX copyPicture)
Method Detail |
---|
public java.lang.String toString()
toString
in class DigitalPicture
public void blacken(int row)
row
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |