CNinePartTiledBitmap Class Reference
[Version 4.0]
a nine-part tiled bitmap
More...
List of all members.
Classes |
| struct | PartOffsets |
Public Member Functions |
| | CNinePartTiledBitmap (const CResourceDescription &desc, const PartOffsets &offsets) |
| | CNinePartTiledBitmap (IPlatformBitmap *platformBitmap, const PartOffsets &offsets) |
| | ~CNinePartTiledBitmap () |
| virtual void | draw (CDrawContext *context, const CRect &rect, const CPoint &offset=CPoint(0, 0), float alpha=1.f) |
|
|
| void | setPartOffsets (const PartOffsets &partOffsets) |
| const PartOffsets & | getPartOffsets () const |
|
|
| CCoord | getWidth () const |
| | get the width of the image
|
| CCoord | getHeight () const |
| | get the height of the image
|
| bool | isLoaded () const |
| | check if image is loaded
|
| const CResourceDescription & | getResourceDescription () const |
| IPlatformBitmap * | getPlatformBitmap () const |
| void | setPlatformBitmap (IPlatformBitmap *bitmap) |
|
|
| virtual void | forget () |
| | decrease refcount and delete object if refcount == 0
|
| virtual void | remember () |
| | increase refcount
|
| virtual int32_t | getNbReference () const |
| | get refcount
|
|
|
| virtual CMessageResult | notify (CBaseObject *sender, IdStringPtr message) |
Protected Types |
| enum | {
kPartTopLeft,
kPartTop,
kPartTopRight,
kPartLeft,
kPartCenter,
kPartRight,
kPartBottomLeft,
kPartBottom,
kPartBottomRight,
kPartCount
} |
Protected Member Functions |
| virtual void | drawParts (CDrawContext *pContext, const CRect &rect, float alpha=1.f) |
| virtual void | calcPartRects (const CRect &inBitmapRect, const PartOffsets &inPartOffset, CRect *outRect) |
| virtual void | drawPart (CDrawContext *inContext, const CRect &inSourceRect, const CRect &inDestRect, float inAlpha=1.f) |
Protected Attributes |
| PartOffsets | offsets |
| CResourceDescription | resourceDesc |
| IPlatformBitmap * | platformBitmap |
Detailed Description
a nine-part tiled bitmap
A nine-part tiled bitmap is tiled in nine parts which are drawing according to its part offsets:
- top left corner
- top right corner
- bottom left corner
- bottom right corner
- top edge, repeated as often as necessary and clipped appropriately
- left edge, dto.
- right edge, dto.
- bottom edge, dto.
- center, repeated horizontally and vertically as often as necessary
|------------------------------------------------------------------------------------------------|
| Top-Left Corner | <---- Top Edge ----> | Top-Right Corner |
|--------------------|-----------------------------------------------------|---------------------|
| ^ | ^ | ^ |
| | | | | | |
| Left Edge | <---- Center ----> | Right Edge |
| | | | | | |
| v | v | v |
|--------------------|-----------------------------------------------------|---------------------|
| Bottom-Left Corner | <---- Bottom Edge ----> | Bottom-Right Corner |
|------------------------------------------------------------------------------------------------|
Member Enumeration Documentation
anonymous enum [protected] |
- Enumerator:
| kPartTopLeft |
|
| kPartTop |
|
| kPartTopRight |
|
| kPartLeft |
|
| kPartCenter |
|
| kPartRight |
|
| kPartBottomLeft |
|
| kPartBottom |
|
| kPartBottomRight |
|
| kPartCount |
|
Constructor & Destructor Documentation
Member Function Documentation
| void calcPartRects |
( |
const CRect & |
inBitmapRect, |
|
|
const PartOffsets & |
inPartOffset, |
|
|
CRect * |
outRect | |
|
) |
| | [protected, virtual] |
| void drawPart |
( |
CDrawContext * |
inContext, |
|
|
const CRect & |
inSourceRect, |
|
|
const CRect & |
inDestRect, |
|
|
float |
inAlpha = 1.f | |
|
) |
| | [protected, virtual] |
| void drawParts |
( |
CDrawContext * |
pContext, |
|
|
const CRect & |
rect, |
|
|
float |
alpha = 1.f | |
|
) |
| | [protected, virtual] |
| virtual void forget |
( |
|
) |
[inline, virtual, inherited] |
decrease refcount and delete object if refcount == 0
| CCoord getHeight |
( |
|
) |
const [inherited] |
get the height of the image
| virtual int32_t getNbReference |
( |
|
) |
const [inline, virtual, inherited] |
| IPlatformBitmap* getPlatformBitmap |
( |
|
) |
const [inline, inherited] |
| CCoord getWidth |
( |
|
) |
const [inherited] |
get the width of the image
| bool isLoaded |
( |
|
) |
const [inline, inherited] |
| virtual void remember |
( |
|
) |
[inline, virtual, inherited] |
| void setPartOffsets |
( |
const PartOffsets & |
partOffsets |
) |
[inline] |
| void setPlatformBitmap |
( |
IPlatformBitmap * |
bitmap |
) |
[inherited] |
Member Data Documentation
The documentation for this class was generated from the following files: