AnnRotate 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 uses the AnnFlip, AnnReverse, and AnnRotate methods. To code this example, add a command button with and ID of IDC_TEST to the example you created in Loading and Displaying an Image. For best results when you run the example, draw two objects in opposite corners, and use the right mouse button to select all annotation objects. The command button then lets you cycle through the AnnFlip, AnnReverse, and AnnRotate methods.

void CTutorDlg::OnButtonAnnrotate() 
{
   CString MyCaption;
   CWnd *pButton = GetDlgItem(IDC_BUTTON_ANNROTATE);
   pButton->GetWindowText(MyCaption);
   if (MyCaption == TEXT("Flip"))
   {
      // Flip using the center of the bitmap as the axis.
      L_FLOAT fBitmapHeight;
      fBitmapHeight =  m_LEADRasterView1.GetRaster().GetBitmapHeight ();
      m_pRasterAnn->AnnFlip(VARIANT_TRUE, fBitmapHeight / 2, VARIANT_TRUE);
      pButton->SetWindowText(TEXT("Reverse"));
   }
   else if (MyCaption == TEXT("Reverse"))
   {
      // Reverse using the center of the bitmap as the axis.
      L_FLOAT fBitmapWidth;
      fBitmapWidth = m_LEADRasterView1.GetRaster().GetBitmapWidth();
      m_pRasterAnn->AnnReverse(VARIANT_TRUE, fBitmapWidth / 2, VARIANT_TRUE);
      pButton->SetWindowText(TEXT("Rotate"));
   }
   else if (MyCaption == TEXT("Rotate"))
   {
      // Rotate 90 degrees using the center of the bitmap as the axis.
      L_FLOAT fBitmapHeight;
      L_FLOAT fBitmapWidth;
      fBitmapHeight  = m_LEADRasterView1.GetRaster().GetBitmapHeight();
      fBitmapWidth  = m_LEADRasterView1.GetRaster().GetBitmapWidth();
      m_pRasterAnn->AnnRotate(VARIANT_TRUE, fBitmapWidth / 2, fBitmapHeight / 2, 90.0f, VARIANT_FALSE);
      pButton->SetWindowText(TEXT("Flip"));
   }
   else
   {
      pButton->SetWindowText(TEXT("Flip"));
      m_pRasterAnn->PutAnnUserMode(ANN_USERMODE_DESIGN);
      m_pRasterAnn->PutAnnTool(ANN_TOOL_REDACT);
      AfxMessageBox(TEXT("Draw two objects, use the right mouse button to select all, then click the command button"));
   }
}