AnnInsert example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

//This example
//1. creates an ellipse annotation object
//2. sizes the ellipse
//3. inserts the ellipse into the annotation container
void CTutorDlg::OnButtonAnninsertann() 
{
   
   long hEllipseObject;
   m_pRasterAnn->AnnCreate(ANN_OBJECT_ELLIPSE, VARIANT_FALSE, VARIANT_TRUE);
    hEllipseObject = m_pRasterAnn->GetAnnObject();
   
   m_pRasterAnn->PutAnnRectLeft(hEllipseObject, 0);
   m_pRasterAnn->PutAnnRectTop(hEllipseObject, 0);
   m_pRasterAnn->PutAnnRectWidth(hEllipseObject, 100);
   m_pRasterAnn->PutAnnRectHeight(hEllipseObject, 100);
   
   m_pRasterAnn->AnnInsert(m_pRasterAnn->GetAnnContainer(), hEllipseObject, VARIANT_FALSE);
}