|
VSTGUI 4.10
Graphical User Interface Framework not only for VST plugins
|
Encapsulates various platform depended kinds of bitmaps. More...
#include <cbitmap.h>
Inheritance diagram for CBitmap:Public Types | |
| using | BitmapVector = std::vector<PlatformBitmapPtr> |
| using | const_iterator = BitmapVector::const_iterator |
Public Member Functions | |
| CBitmap (const CResourceDescription &desc) | |
| Create an image from a resource identifier. | |
| CBitmap (CCoord width, CCoord height) | |
| Create an image with a given size. | |
| CBitmap (CPoint size, double scaleFactor=1.) | |
| Create an image with a given size and scale factor. | |
| CBitmap (const PlatformBitmapPtr &platformBitmap) | |
| ~CBitmap () noexcept override=default | |
Public Member Functions inherited from ReferenceCounted< std::atomic< int32_t > > | |
| ReferenceCounted ()=default | |
| virtual | ~ReferenceCounted () noexcept=default |
| ReferenceCounted (const ReferenceCounted &) | |
| ReferenceCounted & | operator= (const ReferenceCounted &) |
| ReferenceCounted ()=default | |
| ReferenceCounted (const ReferenceCounted &) | |
| virtual | ~ReferenceCounted () noexcept=default |
| ReferenceCounted & | operator= (const ReferenceCounted &) |
| void | forget () override |
| decrease refcount and delete object if refcount == 0 | |
| void | remember () override |
| increase refcount | |
| virtual int32_t | getNbReference () const |
| get refcount | |
| void | forget () override |
| decrease refcount and delete object if refcount == 0 | |
| void | remember () override |
| increase refcount | |
| virtual int32_t | getNbReference () const |
| get refcount | |
CBitmap Methods | |
| CResourceDescription | resourceDesc |
| BitmapVector | bitmaps |
| virtual void | draw (CDrawContext *context, const CRect &rect, const CPoint &offset=CPoint(0, 0), float alpha=1.f) |
| CCoord | getWidth () const |
| get the width of the image | |
| CCoord | getHeight () const |
| get the height of the image | |
| CPoint | getSize () const |
| get size of image | |
| bool | isLoaded () const |
| check if image is loaded | |
| const CResourceDescription & | getResourceDescription () const |
| PlatformBitmapPtr | getPlatformBitmap () const |
| void | setPlatformBitmap (const PlatformBitmapPtr &bitmap) |
| bool | addBitmap (const PlatformBitmapPtr &platformBitmap) |
| PlatformBitmapPtr | getBestPlatformBitmapForScaleFactor (double scaleFactor) const |
| const_iterator | begin () const |
| const_iterator | end () const |
| CBitmap () | |
Encapsulates various platform depended kinds of bitmaps.
In Version 4.0 CBitmap was simplified. Previous versions supported drawing a color transparent of the bitmap. Since CBitmap supports alpha drawing of bitmaps since some time, it's now the only way of drawing a bitmap with some parts transparent.
File format support is handled in a platform dependent way. On Windows GDI+ is used to import images. On Mac OS X CoreGraphics is used to import them. For cross platform compatibility it is recommended to use PNG files.
You load a bitmap via a CResourceDescription which can hold a string or a number. If you use names, you need to use the real filename with extension. Then it gets automaticly loaded on Mac OS X out of the Resources folder of the vst bundle. On Windows you also specify the resource in the .rc file with the real filename.
| using BitmapVector = std::vector<PlatformBitmapPtr> |
| using const_iterator = BitmapVector::const_iterator |
|
explicit |
Create an image from a resource identifier.
Create an image with a given size and scale factor.
|
explicit |
|
overridedefaultnoexcept |
|
protected |
| bool addBitmap | ( | const PlatformBitmapPtr & | platformBitmap | ) |
|
inline |
|
virtual |
Reimplemented in CNinePartTiledBitmap.
|
inline |
| auto getBestPlatformBitmapForScaleFactor | ( | double | scaleFactor | ) | const |
| CCoord getHeight | ( | ) | const |
get the height of the image
| auto getPlatformBitmap | ( | ) | const |
|
inline |
| CPoint getSize | ( | ) | const |
get size of image
| CCoord getWidth | ( | ) | const |
get the width of the image
|
inline |
check if image is loaded
| void setPlatformBitmap | ( | const PlatformBitmapPtr & | bitmap | ) |
|
protected |
|
protected |