|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.fillstyle.MorphBitmapFill
public final class MorphBitmapFill
MorphBitmapFill uses a bitmap image to fill an area of a morphing shape. Four types of bitmap fill are supported:
Two coordinate transforms define the appearance of the image at the start and end of the morphing process. The most common use of the coordinate transform is to scale an image so it displayed at the correct resolution. When an image is loaded its width and height default to twips rather than pixels. An image 300 x 200 pixels will be displayed as 300 x 200 twips (15 x 10 pixels). Scaling the image by 20 (20 twips = 1 pixel) using the CoordTransform object will restore it to its original size.
The coordinate transform is also used to control the image registration. An image is drawn with the top left corner placed at the origin (0, 0) of the shape being filled. The transform can be used to apply different translations to the image so its position can be adjusted relative to the origin of the enclosing shape.
| Constructor Summary | |
|---|---|
MorphBitmapFill(boolean tiled,
boolean smoothed,
int uid,
CoordTransform start,
CoordTransform end)
Creates a MorphBitmapFill specifying the type, bitmap image and coordinate transforms for the image at the start and end of the morphing process. |
|
MorphBitmapFill(int fillType,
SWFDecoder coder)
Creates and initialises a MorphBitmapFill fill style using values encoded in the Flash binary format. |
|
MorphBitmapFill(MorphBitmapFill object)
Creates and initialises a MorphBitmapFill fill style using the values copied from another MorphBitmapFill object. |
|
| Method Summary | |
|---|---|
MorphBitmapFill |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
CoordTransform |
getEndTransform()
Get the coordinate transform defining the appearance of the image at the end of the morphing process. |
int |
getIdentifier()
Get the unique identifier of the bitmap image. |
CoordTransform |
getStartTransform()
Get the coordinate transform defining the appearance of the image at the start of the morphing process. |
boolean |
isSmoothed()
Is the image smoothed to improve display quality. |
boolean |
isTiled()
Is the image tiled across the filled area. |
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
void |
setEndTransform(CoordTransform matrix)
Sets the coordinate transform defining the appearance of the image at the end of the morphing process. |
void |
setIdentifier(int uid)
Sets the identifier of the bitmap image to be used in the morphing process. |
void |
setSmoothed(boolean smoothed)
Indicate whether the image will be smoothed to improve display quality. |
void |
setStartTransform(CoordTransform matrix)
Sets the coordinate transform defining the appearance of the image at the start of the morphing process. |
void |
setTiled(boolean tiled)
Indicate whether the image tiled across the filled area. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MorphBitmapFill(int fillType,
SWFDecoder coder)
throws IOException
fillType - the value used to identify the fill style when it is
encoded.coder - an SWFDecoder object that contains the encoded Flash data.
IOException - if an error occurs while decoding the data.
public MorphBitmapFill(boolean tiled,
boolean smoothed,
int uid,
CoordTransform start,
CoordTransform end)
uid - the unique identifier for the image. Must be in the range
1..65535.tiled - indicates whether the image will be tiled across the area
defined by the shape.smoothed - whether smoothing will be applied to the image to
improve its appearance.start - the coordinate transform defining the appearance of the image
at the start of the morphing process.end - the coordinate transform defining the appearance of the image
at the end of the morphing process.public MorphBitmapFill(MorphBitmapFill object)
object - a MorphBitmapFill fill style from which the values will be
copied.| Method Detail |
|---|
public boolean isTiled()
public void setTiled(boolean tiled)
tiled - true if the image is tiled to completely cover the area to
be filled, false otherwise.public boolean isSmoothed()
public void setSmoothed(boolean smoothed)
smoothed - true if the image will be smoothed, false if smoothing
is not applied.public int getIdentifier()
public CoordTransform getStartTransform()
public CoordTransform getEndTransform()
public void setIdentifier(int uid)
uid - the unique identifier of the bitmap image. Must be in the
range 1..65535.public void setStartTransform(CoordTransform matrix)
matrix - the starting coordinate transform. Must not be null.public void setEndTransform(CoordTransform matrix)
matrix - the ending coordinate transform. Must not be null.public MorphBitmapFill copy()
copy in interface Copyable<FillStyle>public String toString()
toString in class Objectpublic int prepareToEncode(Context context)
prepareToEncode in interface SWFEncodeablecontext - an Context that allows information to be passed between
objects to control how they are initialised for encoding.
public void encode(SWFEncoder coder,
Context context)
throws IOException
encode in interface SWFEncodeablecoder - an SWFEncoder object.context - an Context that allows information to be passed between
objects to control how they are initialised for encoding.
IOException - if an error occurs while encoding the object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||