AnnotationFont Example VC++

This example places a customized rubber stamp at a predetermined location on the image. The AnnotationFont and AnnotationFontColor properties are set to determine the stamp's font and font color.

void CImgEdit1Dlg::OnRubberStamp() 
{
    // Places a customized rubber stamp at a predetermined
    // location on the image.  Font used is Courier and color
    // is red
    COleFont szFontType;
    szFontType = ImgEdit1.GetAnnotationFont();
    szFontType.SetName("Courier New");
    ImgEdit1.SetAnnotationFont(szFontType);
    ImgEdit1.SetAnnotationFontColor(0xFF);  // vbRed
    // This stamp uses embedded text macros for date and time
    ImgEdit1.SetAnnotationStampText("Application received on %B %d, %Y at %H");
    ImgEdit1.SetAnnotationType(8); // wiTextStamp  // 8
    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default
    ImgEdit1.Draw(10, 10, evt, evt);
}