|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecterland.util.SubImageHandler
public class SubImageHandler
Implements a image handler which makes it easier to extract and drag sub images from a large image
Constructor Summary | |
---|---|
SubImageHandler(Image image,
int width,
int height,
int noOfX,
int noOfY)
Creates a image handler which makes it possible to extract sub images from a main image |
|
SubImageHandler(Image image,
int width,
int height,
int noOfX,
int noOfY,
int drawOffsetX,
int drawOffsetY)
Creates a image handler which makes it possible to extract sub images from a main image. |
Method Summary | |
---|---|
void |
drawImage(Graphics g,
int subimage,
int x,
int y)
Draw a specific subimage |
Graphics |
getGraphics(int subimage)
Get a Graphics object for the specified sub image |
Image |
getImage()
Get the main image which contains all sub images |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SubImageHandler(Image image, int width, int height, int noOfX, int noOfY)
image
- The main image to extract sub images fromwidth
- The width of each subimageheight
- The height of each subimagenoOfX
- Number of sub images on each rownoOfY
- Number of rows with sub imagespublic SubImageHandler(Image image, int width, int height, int noOfX, int noOfY, int drawOffsetX, int drawOffsetY)
image
- The main image to extract sub images fromwidth
- The width of each subimageheight
- The height of each subimagenoOfX
- Number of sub images on each rownoOfY
- Number of rows with sub imagesdrawOffsetX
- Number of pixels to add to x coordinate before drawingdrawOffsetY
- Number of pixels to add to y coordinate before drawingMethod Detail |
---|
public void drawImage(Graphics g, int subimage, int x, int y)
g
- The Graphics object to draw onsubimage
- The number of the sub image to drawx
- The x position to draw sub image ony
- The y position to draw sub image onpublic Image getImage()
public Graphics getGraphics(int subimage)
subimage
- The sub image to get a Graphics object for
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |