com.iproject.wbmpcreator
Class WBMPfile

java.lang.Object
  |
  +--com.iproject.wbmpcreator.WBMPfile
Direct Known Subclasses:
WBMPChart, WBMPMultiLayer, WBMPTable

public class WBMPfile
extends java.lang.Object
implements java.io.Serializable

Version:
2.00 after 17.10.2000
Author:
Max Jury Krainov

Copyright (c) 2000 WAP Shareware, Inc. Visit WAP Shareware Visit WBMPcreator homepage

See Also:
Serialized Form

Field Summary
static int ALIGN_CENTER
           
static int ALIGN_HORIZONTAL_CENTER
          A constant value used for aligning bitmaps.
static int ALIGN_HORIZONTAL_LEFT
          A constant value used for aligning bitmaps.
static int ALIGN_HORIZONTAL_RIGHT
          A constant value used for aligning bitmaps.
static int ALIGN_VERTICAL_BOTTOM
          A constant value used for aligning bitmaps.
static int ALIGN_VERTICAL_CENTER
          A constant value used for aligning bitmaps.
static int ALIGN_VERTICAL_TOP
          A constant value used for aligning bitmaps.
static int APPEND_MODE_CONTINUOUS
          A constant value used to append string to a bitmap.
static int APPEND_MODE_DIVISION
          A constant value used to append string to a bitmap.
static int LINE_CHAIN3_1
          Line will look like a chain line with 3-point long lines and 1-point spaces
static int LINE_CHAIN3_2
          Line will look like a chain line with 3-point long lines and 2-point spaces
static int LINE_INT2_1
          Line will look like a group of 2-point intervals lying on a single line and having 1-point space between intervals.
static int LINE_INT2_2
          Line will look like a group of 2-point intervals lying on a single line and having 2-point space between intervals.
static int LINE_INT3_2
          Line will look like a group of 3-point intervals lying on a single line and having 2-point space between intervals.
static int LINE_POINT1
          All points of a line will be drawn with 1 point interval
static int LINE_POINT2
          All points of a line will be drawn with 2 points interval
static int LINE_POINT3
          All points of a line will be drawn with 3 points interval
static int MIX_MODE_AND
          A constant value used for mixing bitmaps.
static int MIX_MODE_NOT
          A constant value used for mixing bitmaps.
static int MIX_MODE_OR
          A constant value used for mixing bitmaps.
static int MIX_MODE_XOR
          A constant value used for mixing bitmaps.
 
Constructor Summary
WBMPfile()
          Empty constructor.
WBMPfile(byte[] bytes)
          Constructor that creates WBMPfile instances from an array of bytes (this can be useful in work with databases).
WBMPfile(int length, int width)
          this constructor creates the blank WBMP file.
WBMPfile(int length, int width, int[][] picData)
          this constructor creates the WBMP file.
WBMPfile(SimpleImageFile image, int red, int green, int blue)
          A new WBMPfile constructor from Image instance.
WBMPfile(java.lang.String filename)
          Constructor with the filename.
WBMPfile(java.lang.String url, int port)
          Method to create WBMPfile instance from WEB This will help much in creating images based on the images stored somewhere in the Internet.
WBMPfile(java.lang.String filename, int filter, boolean invert)
           
 
Method Summary
 WBMPfile align(WBMPfile lowerLayer, WBMPfile upperLayer, int alignMethod, int mixingMethod)
          Method for aligning images one relative to another.
 void convert2WBMPfile(java.lang.String filename)
          Method to convert image into the WBMP format.
 void convert2WBMPfile(java.net.URL imageURL)
          Method to convert remote image into the WBMP format.
 void createWBMPFile()
          Method to create the new WBMPfile filled with white.
 void destroyWBMPFile()
          Removes the WBMPfile instance from memory.
 void draw3DRect(int x, int y, int length, int width, boolean isFilled, boolean isRaised)
          Method to draw a 3D rectangle.
 void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          Method drawing the arc with the following parameters:
 void drawCircle(int x, int y, int radius, int color, boolean isFilled)
          Method to draw a circle.
 void drawCustomString(java.lang.String text, int X, int Y, java.lang.String inFont, int direction)
          Method to draw text with custom font on the current layer.
 void drawLine(int x_1, int y_1, int x_2, int y_2)
          Method to draw a line on the lower layer (current layer).
 void drawOval(int x, int y, int length, int width, boolean isFilled)
          Method to draw oval with the selected length and width
 void drawPoint(int x, int y, int color)
          Method to draw a point with the selected color at the coordinates X, Y.
 void drawRect(int x, int y, int length, int width, boolean isFilled)
          Method to draw a rectangle.
 void drawSpecialLine(int x1, int y1, int x2, int y2, int line_type, int color)
          Method to draw a special line.
 void drawString(java.lang.String text, int X, int Y, java.awt.Font inFont)
          Method to draw text on the current layer.
 WBMPfile drawTTFString(java.lang.String text, java.awt.Font font)
          Method to get a WBMPfile instance of a TTF string written with the selected font.
static WBMPfile executeSequence(java.lang.String seq_name)
          Method to execute sequence - a set of instructions for automatic images generation.
 byte[] getByteArray(java.lang.String format)
          This method gets the byte representation of a resulting image.
 int getElementAt(int X, int Y)
          this int returns the value of the desired point
 WBMPfile getRectArea(WBMPDimension area)
          Method to get a piece of an image.
 java.lang.String getString()
          This method returns java.lang.String representation of a WBMPfile.
 int getWBMPLength()
          Gets the length of the image.
 int[][] getWBMPpic()
          Method to let user obtain point arrays without delay.
 int getWBMPWidth()
          Gets the width of the image.
 void invertWBMPImage()
          This method inverts image so that all black pixels turn into white and vice versa.
 WBMPfile mix(WBMPfile layer1, int mixMode)
          this function mixes the given picture with the current.
 WBMPfile mix(WBMPfile layer1, int mixMode, int X, int Y)
          this function mixes the given picture with the current.
 WBMPfile openEWBMPFile(java.lang.String filename)
          Support for EWBMP image format.
 WBMPfile openWBMPFile(java.lang.String filename)
          Method to read WBMPfile from the disk and to create a WBMPfile instance in memory.
 void printWBMPImage()
          Method to put WBMP image's contents to the screen.
 WBMPfile reduce(int bgColor)
          A very useful methos to find the actual image size.
 WBMPfile rotate(int angle)
          Method to rotate a WBMP image.
 void saveEWBMP2File(java.lang.String filename)
          This method saves the EWBMP file.
 void saveWBMPFile(java.lang.String format, java.lang.String filename)
          Universal method for saving WBMP files in different formats Available parameters: BMP PNG JPG TIFF WBMP EWBMP
 void setElementAt(int X, int Y, int value)
          this void assigns value to the given cell
 void setWBMPLength(int newLength)
          Sets the new length of the image.
 void setWBMPWidth(int newWidth)
          Sets the new width of the image.
 void writeWBMPFile(java.lang.String format, java.io.OutputStream stream)
          Universal method for saving WBMP files in different formats Available parameters: BMP PNG JPG TIFF WBMP EWBMP
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIX_MODE_XOR

public static final int MIX_MODE_XOR
A constant value used for mixing bitmaps. XOR mode

MIX_MODE_AND

public static final int MIX_MODE_AND
A constant value used for mixing bitmaps. AND mode

MIX_MODE_OR

public static final int MIX_MODE_OR
A constant value used for mixing bitmaps. OR mode

MIX_MODE_NOT

public static final int MIX_MODE_NOT
A constant value used for mixing bitmaps. NOT mode

ALIGN_HORIZONTAL_LEFT

public static final int ALIGN_HORIZONTAL_LEFT
A constant value used for aligning bitmaps. The resulting bitmap aligns the upper layer left.
Since:
2.00

ALIGN_HORIZONTAL_RIGHT

public static final int ALIGN_HORIZONTAL_RIGHT
A constant value used for aligning bitmaps. The resulting bitmap aligns the upper layer right.
Since:
2.00

ALIGN_HORIZONTAL_CENTER

public static final int ALIGN_HORIZONTAL_CENTER
A constant value used for aligning bitmaps. The resulting bitmap aligns the upper layer to the center.

ALIGN_VERTICAL_TOP

public static final int ALIGN_VERTICAL_TOP
A constant value used for aligning bitmaps. The resulting bitmap aligns the upper layer left.
Since:
2.00

ALIGN_VERTICAL_BOTTOM

public static final int ALIGN_VERTICAL_BOTTOM
A constant value used for aligning bitmaps. The resulting bitmap aligns the upper layer right.
Since:
2.00

ALIGN_VERTICAL_CENTER

public static final int ALIGN_VERTICAL_CENTER
A constant value used for aligning bitmaps. The resulting bitmap aligns the upper layer to the center.

ALIGN_CENTER

public static final int ALIGN_CENTER

APPEND_MODE_DIVISION

public static final int APPEND_MODE_DIVISION
A constant value used to append string to a bitmap. Currently not used.

APPEND_MODE_CONTINUOUS

public static final int APPEND_MODE_CONTINUOUS
A constant value used to append string to a bitmap. Currently not used.

LINE_POINT1

public static final int LINE_POINT1
All points of a line will be drawn with 1 point interval

LINE_POINT2

public static final int LINE_POINT2
All points of a line will be drawn with 2 points interval

LINE_POINT3

public static final int LINE_POINT3
All points of a line will be drawn with 3 points interval

LINE_INT2_1

public static final int LINE_INT2_1
Line will look like a group of 2-point intervals lying on a single line and having 1-point space between intervals.

LINE_INT2_2

public static final int LINE_INT2_2
Line will look like a group of 2-point intervals lying on a single line and having 2-point space between intervals.

LINE_INT3_2

public static final int LINE_INT3_2
Line will look like a group of 3-point intervals lying on a single line and having 2-point space between intervals.

LINE_CHAIN3_1

public static final int LINE_CHAIN3_1
Line will look like a chain line with 3-point long lines and 1-point spaces

LINE_CHAIN3_2

public static final int LINE_CHAIN3_2
Line will look like a chain line with 3-point long lines and 2-point spaces
Constructor Detail

WBMPfile

public WBMPfile()
Empty constructor. Does really nothing except instantiating this class.

WBMPfile

public WBMPfile(java.lang.String filename)
         throws java.io.IOException
Constructor with the filename. A file with the given name will be opened and converted into a WBMPfile instance. This constructor doesn't throw any exception so the programmer should be aware of filename correctness.
Throws:
java.io.IOException -  

WBMPfile

public WBMPfile(int length,
                int width)
this constructor creates the blank WBMP file.
Parameters:
length - the length of a WBMP file in pixels
width - the width of a WBMP image in pixels
Since:
1.0

WBMPfile

public WBMPfile(int length,
                int width,
                int[][] picData)
this constructor creates the WBMP file.
Parameters:
length - the length of a WBMP file in pixels
width - the width of a WBMP image in pixels
picData - the array of points of a WBMP file
Since:
1.0

WBMPfile

public WBMPfile(java.lang.String url,
                int port)
Method to create WBMPfile instance from WEB This will help much in creating images based on the images stored somewhere in the Internet.
Parameters:
url - the URL of a wbmp file. MUST be with "http://" or another beginning.
port - port for the URL (for HTTP it is 80)
Since:
1.23

Example:

 // something before opening the image from Internet
 // opening
 WBMPfile wf=new WBMPfile("http://wbmpcreator.iproject.ru/Training/chart.wbmp");
 // other actions with the image
 

If an image is unavailable, a blank 96x44 image is created instead.


WBMPfile

public WBMPfile(byte[] bytes)
Constructor that creates WBMPfile instances from an array of bytes (this can be useful in work with databases).
Parameters:
bytes - the array of bytes containing contents of a WBMP file
Since:
1.61

WBMPfile

public WBMPfile(SimpleImageFile image,
                int red,
                int green,
                int blue)
A new WBMPfile constructor from Image instance. It is used like the following:
 SimpleImageFile sif=new SimpleImageFile("your_filename");
 WBMPfile wf=new WBMPfile(sif, 128,128,128); // for constant threshold
 wf.saveWBMP2File("your_filename.wbmp");
 

The following example shows how to use adoptive thresolds:

 SimpleImageFile sif=new SimpleImageFile("your_filename");
 WBMPfile wf=new WBMPfile(sif, -1,-1,-1); // for adoptive threshold
 wf.saveWBMP2File("your_filename.wbmp");
 

If you want to use adoptive threshold for only selected color channels, just use the following construction (here RED color is static):

 SimpleImageFile sif=new SimpleImageFile("your_filename");
 WBMPfile wf=new WBMPfile(sif, 128,-1,-1); // for adoptive threshold
 wf.saveWBMP2File("your_filename.wbmp");
 
In this example only GREEN and BLUE color channels use adoptive threshold, and RED channel is set to 128 imdependent from what is set as a parameter.
Parameters:
image - the SimpleImageFile instance
red - the RED threshold
green - the GREEN threshold
blue - the BLUE threshold
Since:
1.40

WBMPfile

public WBMPfile(java.lang.String filename,
                int filter,
                boolean invert)
         throws java.lang.InterruptedException
Method Detail

setWBMPLength

public void setWBMPLength(int newLength)
Sets the new length of the image.

getWBMPLength

public int getWBMPLength()
Gets the length of the image.

setWBMPWidth

public void setWBMPWidth(int newWidth)
Sets the new width of the image.

getWBMPWidth

public int getWBMPWidth()
Gets the width of the image.

createWBMPFile

public void createWBMPFile()
Method to create the new WBMPfile filled with white. NOTE: length and width must be specified before!
Since:
1.0

destroyWBMPFile

public void destroyWBMPFile()
Removes the WBMPfile instance from memory.

setElementAt

public void setElementAt(int X,
                         int Y,
                         int value)
this void assigns value to the given cell

getElementAt

public int getElementAt(int X,
                        int Y)
this int returns the value of the desired point

printWBMPImage

public void printWBMPImage()
Method to put WBMP image's contents to the screen. White color is substituted with 1, black color is substituted with 0.
Since:
1.03

invertWBMPImage

public void invertWBMPImage()
This method inverts image so that all black pixels turn into white and vice versa. Sometimes it may be useful.
Since:
1.06

mix

public WBMPfile mix(WBMPfile layer1,
                    int mixMode)
this function mixes the given picture with the current. Assuming the resolution to be the same
Parameters:
layer1 - the upper layer (the given picture)
mixMode - the way to mix the pictures

mix

public WBMPfile mix(WBMPfile layer1,
                    int mixMode,
                    int X,
                    int Y)
this function mixes the given picture with the current. Assuming the resolutions different
Parameters:
layer1 - the upper layer (the given picture)
mixMode - the way to mix the pictures
X - the upper left X coordinate of the lower layer
Y - the upper left Y coorinate of the lower layer

drawString

public void drawString(java.lang.String text,
                       int X,
                       int Y,
                       java.awt.Font inFont)
Method to draw text on the current layer.
Parameters:
text - the text to be drawn
X - the lower left X coordinate of the layer
Y - the lower left Y coordinate of the layer
inFont - the TTF font to be used

NOTE that it can work on Java version 1.2 and higher platforms.


drawCustomString

public void drawCustomString(java.lang.String text,
                             int X,
                             int Y,
                             java.lang.String inFont,
                             int direction)
                      throws java.io.FileNotFoundException
Method to draw text with custom font on the current layer.
Parameters:
text - the text to be drawn
X - the lower left X coordinate of the layer
Y - the lower left Y coordinate of the layer
inFont - the custom font to be used (refer to documentation for details). If you want to use the built-in custon 4x6 font - set this parameter to STANDARD
Since:
1.30

drawLine

public void drawLine(int x_1,
                     int y_1,
                     int x_2,
                     int y_2)
Method to draw a line on the lower layer (current layer).
Parameters:
x_1 - X coordinate of FROM point
y_1 - Y coordinate of FROM point
x_2 - X coordinate of TO point
y_2 - Y coordinate of TO point

Benchmark: Intel Pentium III - 600, 128 Mb RAM PC-133 0(!!!)ms


drawOval

public void drawOval(int x,
                     int y,
                     int length,
                     int width,
                     boolean isFilled)
Method to draw oval with the selected length and width
Parameters:
x - X coordinate of left upper corner
y - Y coordinate of left upper corner
length - length of the oval
width - width of the oval
isFilled - fills (true) or not (false) the oval

Benchmark: Intel Pentium III - 600, 128 Mb RAM PC-133 0(!!!)ms


drawPoint

public void drawPoint(int x,
                      int y,
                      int color)
Method to draw a point with the selected color at the coordinates X, Y.
Parameters:
x - X coordinate of a point
y - Y coordinate of a point
color - the color of a point. NOTE! Due to WAP phones support only b&w picture mode, it's better to use 1 and 0 colors.

drawRect

public void drawRect(int x,
                     int y,
                     int length,
                     int width,
                     boolean isFilled)
Method to draw a rectangle.
Parameters:
x - X coordinate of upper left corner of a rectangle
y - Y coordinate of upper left corner of a rectangle
length - length of a rectangle
width - width of a rectangle
isFilled - fills (true) or not (false) the rectangle

Benchmark: Intel Pentium III - 600, 128 Mb RAM PC-133 0(!!!)ms


draw3DRect

public void draw3DRect(int x,
                       int y,
                       int length,
                       int width,
                       boolean isFilled,
                       boolean isRaised)
Method to draw a 3D rectangle.
Parameters:
x - X coordinate of upper left corner of a 3D rectangle
y - Y coordinate of upper left corner of a 3D rectangle
length - length of a 3D rectangle
width - width of a 3D rectangle
isFilled - fills (true) or not (false) a 3D rectangle
isRaised - is the border raised? true/false

Benchmark: Intel Pentium III - 600, 128 Mb RAM PC-133 0(!!!)ms


drawArc

public void drawArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Method drawing the arc with the following parameters:
Parameters:
x - the X coordinate of the left upper point of a rectangle containing the arc
y - the X coordinate of the left upper point of a rectangle containing the arc
width - the width of a rectangle containing the arc
height - the height of a rectangle containing the arc
startAngle - refer to java.awt.Graphics for details
arcAngle - refer to java.awt.Graphics for details

Benchmark: Intel Pentium III - 600, 128 Mb RAM PC-133 0(!!!)ms


getString

public java.lang.String getString()
This method returns java.lang.String representation of a WBMPfile. This may be useful for storing WBMP pictures in any database and for simplifying the work with it.
The output format is quite the same as WBMP. The only difference is that saveWBMP2File() writes the file to the disk and this metod returns a string available fo any future use.
Since:
1.06
See Also:
WBMPcreator.WBMPfile#saveWBMP2File()

rotate

public WBMPfile rotate(int angle)
Method to rotate a WBMP image. The result is also WBMP image with other dimensions: length of WBMP image turns into width and v.v. This is true for odd values of angle variable
Parameters:
angle - an integer representing quantity of Pi/2 rotations in positive direction (mathematicians will understand me :-|). I.e. if angle equals 0 then the image remains the same. If angle is even then dimensions also remain the same and if it is equal to n*4 where n is an integer then the picture returned is equal to current. Odd values of angle modify dimensions.
Since:
1.07

getRectArea

public WBMPfile getRectArea(WBMPDimension area)
Method to get a piece of an image.
Parameters:
area - a dimension
Since:
1.07
See Also:
WBMPcreator.WBMPDimension#WBMPDimension()

getWBMPpic

public int[][] getWBMPpic()
Method to let user obtain point arrays without delay.
Since:
1.13

drawCircle

public void drawCircle(int x,
                       int y,
                       int radius,
                       int color,
                       boolean isFilled)
Method to draw a circle. It can also run on Java 1.0 platform as well as on the 1.1 Java platform.
Parameters:
x - the centre point x axis coordinate
y - the centre point y axis coordinate
radius - the radius of a circle
color - the color of a circle
isFilled - is the circle filled
Since:
1.21

Benchmark: Intel Pentium III - 600, 128 Mb RAM PC-133 0(!!!)ms


drawSpecialLine

public void drawSpecialLine(int x1,
                            int y1,
                            int x2,
                            int y2,
                            int line_type,
                            int color)
Method to draw a special line. It can also run on Java 1.0 platform as well as on the 1.1 Java platform.
Parameters:
x1 - the first point x axis coordinate
y1 - the first point y axis coordinate
x2 - the second point x axis coordinate
y2 - the second point y axis coordinate
line_type - the type of a special line
color - the color of a line
Since:
1.22

Benchmark: Intel Pentium III - 600, 128 Mb RAM PC-133 0 (!!!) ms Note that the dotted line can be like the simple line. In this case you should increase the point-to-point interval. It is connected with the angle of a line.


openEWBMPFile

public WBMPfile openEWBMPFile(java.lang.String filename)
                       throws java.io.IOException
Support for EWBMP image format.

A short glance at EWBMP. It's not a standard of Nokia or any other WAP standard developers. It's just a useful tip. All EWBMP instances are handled as ordinary WBMP with one exception: to save the EWBMP file you should use this method because the result of saveWBMP2File method will give just WBMPLength%256 and WBMPWidth%256 dimensions which will not be correct.

The only difference between WBMP and EWBMP is that the second format uses the 2-bytes representation of either length and width of an image instead of 1 byte. Thus, the resulting image can have dimension up to 65535*65535 points. I don't really know the sphere of usage of these large files but support for them, I believe, will be necessary in future.

This method opens the EWBMP file and reads its content to a WBMPfile instance (its inner realization supports large images).

Parameters:
filename - the filename of a EWBMP image
Throws:
java.io.IOException -  

saveEWBMP2File

public void saveEWBMP2File(java.lang.String filename)
This method saves the EWBMP file. For more details on EWBMP images refer to openEWBMPFile method.
Parameters:
filename - the filename of a EWBMP image

executeSequence

public static WBMPfile executeSequence(java.lang.String seq_name)
                                throws java.io.FileNotFoundException,
                                       BadSequenceLineException
Method to execute sequence - a set of instructions for automatic images generation. After execution it gives the WBMPfile instance. A sequence file MUST have the *.wbmpseq extension.

Some words about sequences. As follows from its definition, a sequence is a set of instructions that guide the program what to do. A sequence language is very simple: just mention the function you want to execute regarding current image. This is the full list of keywords and syntax elements of the sequence language (all instructions are case-sensitive, booleans are represented as true or false; Strings look like "a string"):

# - the comment symbol. All characters after this symbol will be removed. If this symbol meets in the text (for example, as a text part), it should be duplicated.

SIZE x y the size of a resulting image. If this instruction is not mentioned - the resulting image will have 96x45 resolution.

DRAWARC x y width height startAngle arcAngle

DRAWCIRCLE x y radius color isFilled

DRAWLINE x_1 y_1 x_2 y_2

DRAWOVAL x y length width isFilled

DRAWPOINT x y color

DRAWRECT x y length width isFilled

DRAW3DRECT x y length width isFilled isRaised

DRAWSPECIALLINE x1 y1 x2 y2 line_type color

DRAWCUSTOMSTRING text X Y inFont set inFont to "CUSTOM" is you wish to use the built-in font

Descriptions to all methods are available at the appropriate methods. This will be very useful for automating the creative process.

Parameters:
seq_name - the filename of a sequence WITHOUT extension

openWBMPFile

public WBMPfile openWBMPFile(java.lang.String filename)
                      throws java.io.IOException
Method to read WBMPfile from the disk and to create a WBMPfile instance in memory. Since version 2.00 it also supports OTB images (used for OTA).
Parameters:
filename - the name of a file to be read.
Throws:
java.io.IOException -  
Since:
1.05

convert2WBMPfile

public void convert2WBMPfile(java.lang.String filename)
Method to convert image into the WBMP format. It supports JPEG, GIF, BMP files formats.
Parameters:
filename - the filename of an image
Since:
1.40

convert2WBMPfile

public void convert2WBMPfile(java.net.URL imageURL)
Method to convert remote image into the WBMP format. It supports JPEG, GIF files formats.
Parameters:
filename - the filename of an image
Since:
1.40

saveWBMPFile

public void saveWBMPFile(java.lang.String format,
                         java.lang.String filename)
Universal method for saving WBMP files in different formats Available parameters:
Since:
1.60

writeWBMPFile

public void writeWBMPFile(java.lang.String format,
                          java.io.OutputStream stream)
Universal method for saving WBMP files in different formats Available parameters:
Since:
1.60

getByteArray

public byte[] getByteArray(java.lang.String format)
This method gets the byte representation of a resulting image. You may use it for manual operations with WBMP or OTA images. Usage:
byte[] _dataOut=image.getByteArray("OTA");
 
Since:
2.00

align

public WBMPfile align(WBMPfile lowerLayer,
                      WBMPfile upperLayer,
                      int alignMethod,
                      int mixingMethod)
Method for aligning images one relative to another.
Parameters:
lowerLayer - the WBMPfile instance which lies UNDER the other image
opperLayer - the WBMPfile instance which lies ABOVE the other image
alignMethod - the type of aligning images
mixingMethod - the type of mixing
Since:
2.00 NOTE! lowerlayer must be larger than the upperLayer.

drawTTFString

public WBMPfile drawTTFString(java.lang.String text,
                              java.awt.Font font)
Method to get a WBMPfile instance of a TTF string written with the selected font. NOTE that any string written with TTF font can be visible only if the font size is equal or exceeds 10.
Parameters:
text - the text to be written
font - the java.awt.Font instance to be used
Returns:
the WBMPfile instance of a TTF string
Since:
2.00

reduce

public WBMPfile reduce(int bgColor)
A very useful methos to find the actual image size. If the image has 50x20 dimensions and the area which contains actual image is just 30x10, this method will return a WBMPfile with 30x10 dimensions. This method works correctly only if the background doesn't contain any point not relating to the actual image.
Parameters:
bgColor - the background color (1 relates to BLACK, 0 related to WHITE)
Returns:
the WBMPfile instance of a resulting area