The one Oli linked to was not exactly what I was after but it showed me how to do it.(I simply wanted an unchanging text label positioned near the bitmap.) The rectangle of the control covers the text, so that the control can be changed by click-dragging an area including the label.
Here it is:
Code:
class IMultiBitmapLabelled : public IKnobControl
{
private:
IRECT mTextRECT, mImgRECT;
IBitmap mBitmap;
char Label[20];
public:
IMultiBitmapLabelled(IPlugBase* pPlug, IRECT pR, int paramIdx, IBitmap* pBitmap, IText* pText,char*label)
: IKnobControl(pPlug, pR, paramIdx), mBitmap(*pBitmap)
{
strcpy(Label,label);
mText = *pText;
mTextRECT = IRECT(mRECT.L, mRECT.B- mText.mSize, mRECT.R, mRECT.B);
mImgRECT = IRECT(mRECT.L+(mRECT.R- mRECT.L-(pBitmap->W))/2,mRECT.T,&mBitmap);//place bitmap centred
}
~IMultiBitmapLabelled() {}
bool Draw(IGraphics* pGraphics)
{
int i = 1 + int(0.5 + mValue * (double)(mBitmap.N - 1));
i = BOUNDED(i, 1, mBitmap.N);
pGraphics->DrawBitmap(&mBitmap, &mImgRECT, i, &mBlend);
return pGraphics->DrawIText(&mText, Label, &mTextRECT);
}
};