|
Genuts API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.genuts.gameui.image.PictureExtractor
Extracts all pictures from a given image.
The background color is designed by the point on coordinates (0,0)
of the image, and the border color of pictures is found with the first
angle of the same color.
The order of returning pictures is given from the left to the right, and
from top to bottom.
For example, the following image contains 3 pictures:
In order, you will receive:
Picture 0![]() |
Picture 1![]() |
Picture 2![]() |
Picture 3![]() |
Picture 4![]() |
Picture 5![]() |
Of course, you can and it is recommended to arrange pictures to loose less as possible space in the image, the size depend of it.
For compatibility reason with JDK 1.1, transparent color is not preserved, we recommend you
to use TransparentColorFilter
class
for this purpose.
Constructor Summary | |
PictureExtractor(java.awt.Component component)
Creates the picture extractor. |
Method Summary | |
java.awt.Image[] |
getAllPictures(java.awt.Image image)
Extracts all pictures from an image. |
java.awt.Image[] |
getAllPictures(java.lang.String file)
Extracts all pictures from an image file. |
java.awt.Image[] |
getAllPictures(java.net.URL url)
Extracts all pictures from an url. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PictureExtractor(java.awt.Component component)
component
- A visible component to use for image manipulation.Method Detail |
public java.awt.Image[] getAllPictures(java.lang.String file)
file
- The image file from which pictures are extracted
null
if there is no picture found.public java.awt.Image[] getAllPictures(java.net.URL url)
url
- The url from which pictures are extracted.
null
if there is no picture found.public java.awt.Image[] getAllPictures(java.awt.Image image)
image
- The image from which pictures are extracted
null
if there is no picture found.
|
Genuts API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |