AnnSaveTag 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.

The following example saves selected objects as a Wang compatible TIFF tag.

//This sample saves all objects in Wang TIFF tag, clears the rasterview control, and reloads the image
void CTutorDlg::OnButtonAnnsavetag() 
{
   ILEADRasterIO *pRasterIO=NULL;
   CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
   
   m_pRasterAnn->AnnSaveTag (pRasterIO, VARIANT_TRUE, VARIANT_FALSE);
   pRasterIO->Save(m_LEADRasterView1.GetRaster(), 
      "c:\\testwang.tif", 
      (RasterFileConstants)FILE_CCITT_GROUP4, 
      1, 
      (QFactorConstants)2, 
      SAVE_OVERWRITE);
   
   //clear the LEAD raster view control
   m_LEADRasterView1.GetRaster().SetBitmap(0);
   
   //Reload the image with the wang-compatible annotations
   pRasterIO->Load(m_LEADRasterView1.GetRaster(), "c:\\testwang.tif", 0, 0, 1);
   m_pRasterAnn->AnnLoad("c:\\testwang.tif", 1);
   m_pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN;
   
   pRasterIO->Release();
}