VSTGUI  4.9
Graphical User Interface Framework not only for VST plugins
CNinePartTiledBitmap Class Reference

a nine-part tiled bitmap More...

+ Inheritance diagram for CNinePartTiledBitmap:

Public Member Functions

 CNinePartTiledBitmap (const CResourceDescription &desc, const CNinePartTiledDescription &offsets)
 
 CNinePartTiledBitmap (const PlatformBitmapPtr &platformBitmap, const CNinePartTiledDescription &offsets)
 
 ~CNinePartTiledBitmap () noexcept override=default
 
void draw (CDrawContext *context, const CRect &rect, const CPoint &offset=CPoint(0, 0), float alpha=1.f) override
 
Part Offsets
void setPartOffsets (const CNinePartTiledDescription &partOffsets)
 
const CNinePartTiledDescriptiongetPartOffsets () const
 
- Public Member Functions inherited from CBitmap
 CBitmap (const CResourceDescription &desc)
 Create an image from a resource identifier. More...
 
 CBitmap (CCoord width, CCoord height)
 Create an image with a given size. More...
 
 CBitmap (CPoint size, double scaleFactor=1.)
 Create an image with a given size and scale factor. More...
 
 CBitmap (const PlatformBitmapPtr &platformBitmap)
 
 ~CBitmap () noexcept override=default
 
CCoord getWidth () const
 get the width of the image More...
 
CCoord getHeight () const
 get the height of the image More...
 
CPoint getSize () const
 get size of image More...
 
bool isLoaded () const
 check if image is loaded More...
 
const CResourceDescriptiongetResourceDescription () const
 
PlatformBitmapPtr getPlatformBitmap () const
 
void setPlatformBitmap (const PlatformBitmapPtr &bitmap)
 
bool addBitmap (const PlatformBitmapPtr &platformBitmap)
 
PlatformBitmapPtr getBestPlatformBitmapForScaleFactor (double scaleFactor) const
 
- Public Member Functions inherited from ReferenceCounted< T >
 ReferenceCounted ()=default
 
virtual ~ReferenceCounted () noexcept=default
 
 ReferenceCounted (const ReferenceCounted &)
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
void forget () override
 decrease refcount and delete object if refcount == 0 More...
 
void remember () override
 increase refcount More...
 
virtual int32_t getNbReference () const
 get refcount More...
 
virtual void beforeDelete ()
 

Protected Attributes

CNinePartTiledDescription offsets
 
- Protected Attributes inherited from CBitmap
CResourceDescription resourceDesc
 
BitmapVector bitmaps
 

Additional Inherited Members

- Public Types inherited from CBitmap
using PlatformBitmapPtr = SharedPointer< IPlatformBitmap >
 
- Protected Types inherited from CBitmap
using BitmapVector = std::vector< PlatformBitmapPtr >
 
- Protected Member Functions inherited from CBitmap
 CBitmap ()
 

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 |
|------------------------------------------------------------------------------------------------|

Constructor & Destructor Documentation

◆ CNinePartTiledBitmap() [1/2]

CNinePartTiledBitmap ( const CResourceDescription desc,
const CNinePartTiledDescription offsets 
)

◆ CNinePartTiledBitmap() [2/2]

CNinePartTiledBitmap ( const PlatformBitmapPtr platformBitmap,
const CNinePartTiledDescription offsets 
)

◆ ~CNinePartTiledBitmap()

~CNinePartTiledBitmap ( )
overridedefaultnoexcept

Member Function Documentation

◆ draw()

void draw ( CDrawContext context,
const CRect rect,
const CPoint offset = CPoint (0, 0),
float  alpha = 1.f 
)
overridevirtual

Reimplemented from CBitmap.

◆ getPartOffsets()

const CNinePartTiledDescription& getPartOffsets ( ) const
inline

◆ setPartOffsets()

void setPartOffsets ( const CNinePartTiledDescription partOffsets)
inline

Member Data Documentation

◆ offsets

CNinePartTiledDescription offsets
protected

The documentation for this class was generated from the following files: