AnnHitTest Example for Visual C++
long hObj;
if(m_pRasterAnn->AnnHitTest (m_pRasterAnn->GetAnnContainer (), 100, 100) == ANN_HIT_BODY)
{
hObj = m_pRasterAnn->GetAnnHitTestObject();
m_pRasterAnn->AnnSetName (hObj, TRUE, "AnnHitFound", FALSE);
AnnObjectType nType;
m_pRasterAnn->AnnGetType (hObj);
nType = m_pRasterAnn->GetAnnType();
if(nType == ANN_OBJECT_TEXT)
{
m_pRasterAnn->AnnSetFontBold (hObj, !m_pRasterAnn->AnnGetFontBold (hObj), FALSE);
m_pRasterAnn->AnnSetFontItalic (hObj, !m_pRasterAnn->AnnGetFontItalic (hObj), FALSE);
m_pRasterAnn->AnnSetFontStrikeThrough (hObj, !m_pRasterAnn->AnnGetFontStrikeThrough (hObj), FALSE);
m_pRasterAnn->AnnSetFontUnderline (hObj, !m_pRasterAnn->AnnGetFontUnderline (hObj), FALSE);
m_pRasterAnn->AnnSetFontName (hObj, m_pRasterAnn->AnnGetFontName (hObj), FALSE);
m_pRasterAnn->AnnSetFontSize (hObj, ((int)m_pRasterAnn->AnnGetFontSize (hObj)-9) %10 +10, FALSE);
VARIANT_BOOL bShow;
m_pRasterAnn->AnnSetText (hObj, m_pRasterAnn->AnnGetText (hObj) + m_pRasterAnn->AnnGetName (hObj, &bShow), FALSE);
}
}