AnnRotate example for C++ 4.0 and later

Note: This topic is for Document/Medical only.

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::OnTest() 
{
  CString MyCaption;
  CWnd *pButton = GetDlgItem(IDC_TEST);
  pButton->GetWindowText(MyCaption);

if (MyCaption == "Flip")
{
  // Flip using the center of the bitmap as the axis.
  m_Lead1.AnnFlip(TRUE, m_Lead1.GetBitmapHeight() / 2, TRUE);
  pButton->SetWindowText("Reverse");
}
else if (MyCaption == "Reverse")
{
  // Reverse using the center of the bitmap as the axis.
  m_Lead1.AnnReverse(TRUE, m_Lead1.GetBitmapWidth() / 2, TRUE);
  pButton->SetWindowText("Rotate");
}
else if (MyCaption == "Rotate")
{
   // Rotate 90 degrees using the center of the bitmap as the axis.
  m_Lead1.AnnRotate(TRUE, m_Lead1.GetBitmapWidth() / 2, m_Lead1.GetBitmapHeight() / 2, 90.0f, TRUE);
  pButton->SetWindowText("Flip");
}
else
{
  pButton->SetWindowText("Flip");
  m_Lead1.SetAnnUserMode(ANNUSERMODE_DESIGN);
  m_Lead1.SetAnnTool(ANNTOOL_REDACT);
  MessageBox("Draw two objects, use the right mouse button to select all, then click the command button");
}

}