AnnSetFillModeExt example for Visual C++
// The following example toggles through all supported fill modes for an annotation object.
// The background color is set to blue in each case
void CAnnCOMView::ExampleAnnGetFillModeExt()
{
int nRet = 0;
short nFillMode =0;
long hObject =0;
m_pltAnn->AnnCreate(ANN_OBJECT_HILITE, TRUE, TRUE);
hObject = m_pltAnn->GetAnnObject();
m_pltAnn->PutAnnRectLeft(hObject,0);
m_pltAnn->PutAnnRectTop(hObject,0);
m_pltAnn->PutAnnRectWidth(hObject,100);
m_pltAnn->PutAnnRectHeight(hObject,100);
nRet = m_pltAnn->AnnSetSelected(hObject, TRUE, FALSE);
nRet = m_pltAnn->AnnGetFillModeExt(hObject);
nRet = m_pltAnn->AnnSetBackColor(hObject, RGB(0, 0, 255), TRUE);
nFillMode = m_pltAnn->AnnFillMode;
switch(nFillMode)
{
case ANN_FILLMODE_TRANSPARENT:
nFillMode = ANN_FILLMODE_TRANSLUCENT;
break;
case ANN_FILLMODE_TRANSLUCENT:
nFillMode = ANN_FILLMODE_OPAQUE;
break;
case ANN_FILLMODE_OPAQUE:
nFillMode = ANN_FILLMODE_ALPHA;
break;
case ANN_FILLMODE_ALPHA:
default:
nFillMode = ANN_FILLMODE_TRANSPARENT;
break;
}
// Arbitrarily set an alpha value of 128
// Note that this value is used only if the nFillMode is ANN_FILLMODE_ALPHA
nRet = m_pltAnn->AnnSetFillModeExt(hObject, nFillMode, 128, TRUE);
nRet = m_pltAnn->AnnGetFillModeExt(hObject);
if (m_pltAnn->AnnFillMode == ANN_FILLMODE_ALPHA)
{
CString strMsg;
strMsg.Format(TEXT("Alpha : %d"), m_pltAnn->AnnAlpha);
MessageBox(strMsg);
}
}