|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--AnimatedImage.AnimatedImage
This class provide a method to animate images with memory image source. We can manipulate the animated image with an array of pixels.
| Field Summary | |
protected int |
height
This represents the height of the memory image source |
protected Image |
image
This represents the image of our memory image source. |
protected MemoryImageSource |
memoryImageSource
This represents our memory image source. |
protected int[] |
pixels
This represents the pixels of the memory image source. |
protected int |
width
This represents the width of the memory image source |
| Constructor Summary | |
AnimatedImage(int width,
int height,
Color backgroundColor)
The constructor. |
|
| Method Summary | |
int |
height()
Method which return the height of the animatedImage. |
Image |
image()
Method which returns the image created via the animatedImage. |
void |
init(Color color)
This method initialize our animatedImage with the white color. |
int[] |
pixels()
Method which return the array of pixels of our animatedImage. |
void |
pixels(int index,
int value)
Method which replace one pixel of the animatedImage'pixels array with the indicated value. |
void |
updateAnimatedImage()
Method which send the whole buffer of pixels to the memory image source in order to update it and to do the animation. |
void |
updateAnimatedImage(int xOrigin,
int yOrigin,
int width,
int height)
Method which tells the memory image source to update only one part of his buffer. |
int |
width()
Method which return the width of the animatedImage. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected Image image
protected MemoryImageSource memoryImageSource
protected int[] pixels
protected int width
protected int height
| Constructor Detail |
public AnimatedImage(int width,
int height,
Color backgroundColor)
width - The width of our animatedImage.height - The height of our animatedImage.backgroundColor - The background color of our animatedImage.| Method Detail |
public void init(Color color)
public void updateAnimatedImage()
public void updateAnimatedImage(int xOrigin,
int yOrigin,
int width,
int height)
xOrigin - The x origin of the buffer.yOrigin - The y origin of the buffer.width - The width of the buffer.height - The height of the buffer.public Image image()
public int[] pixels()
public void pixels(int index,
int value)
throws AnimatedImageError
index - The pixel we want to change.value - The new value of the pixel.public int width()
public int height()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||