|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.util.BackgroundTiler
public class BackgroundTiler
Used to tile a background image into regions of various sizes. The source image is divided into nine quadrants (of mostly equal size) which are tiled accordingly to fill whatever size background image is desired.
| Field Summary | |
|---|---|
protected int |
_ch3
The size of the center chunk of our subdivided images. |
protected int |
_cw3
The size of the center chunk of our subdivided images. |
protected int |
_h3
One third of width/height of our source image. |
protected BufferedImage[] |
_tiles
Our nine sub-divided images. |
protected int |
_w3
One third of width/height of our source image. |
| Constructor Summary | |
|---|---|
BackgroundTiler(BufferedImage src)
Creates a background tiler with the specified source image. |
|
| Method Summary | |
|---|---|
int |
getNaturalHeight()
Returns the "natural" height of the image being used to tile the background. |
int |
getNaturalWidth()
Returns the "natural" width of the image being used to tile the background. |
void |
paint(Graphics g,
int x,
int y,
int width,
int height)
Fills the requested region with the background defined by our source image. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected BufferedImage[] _tiles
protected int _w3
protected int _h3
protected int _cw3
protected int _ch3
| Constructor Detail |
|---|
public BackgroundTiler(BufferedImage src)
| Method Detail |
|---|
public int getNaturalWidth()
public int getNaturalHeight()
public void paint(Graphics g,
int x,
int y,
int width,
int height)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||