Draw Example VC++

This example uses the SelectTool method to select the Text From File annotation type.  It then uses the content of the AnnotationTextFile property and the Draw method to overlay text from a text file onto an image.

void CImgEdit1Dlg::OnSelectTool() 
{
    // Uses the SelectTool method to select the Text from file
    // annotation type.  Overlays text from a text file onto an
    // image.
    
    // If the annotation tool palette is utilized within an
    // application, SelectTool should be used rather than
    // setting the AnnotationType property for drawing marks
    // programatically.
    ImgEdit1.SelectTool(9); // Text from file
    ImgEdit1.SetAnnotationTextFile("C:\\text\\disclaim.txt");
    VARIANT evt; V_VT(&evt) = VT_ERROR;   // set to default
    ImgEdit1.Draw(10, 10, evt, evt);
}