GetSelectedAnnotationLineColor Example VC++

This example uses the GetSelectedAnnotationLineColor method to determine the color of a selected line annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationLineColor method to change the color of a selected line annotation.

void CImgEdit2Dlg::OnLinecolor() 
{
    // This example uses the Microsoft color dialog box to
    // change a selected annotation mark's line color.

    long LineColor;
    // Determine the current color of the selected annotation
    // mark and init the dialog box color property to that color.
    LineColor = ImgEdit1.GetSelectedAnnotationLineColor();
    CommonDialog1.SetColor(LineColor);
    CommonDialog1.SetFlags(1); // cdlCCRGBInit
    CommonDialog1.ShowColor();
    ImgEdit1.SetSelectedAnnotationLineColor(CommonDialog1.GetColor());
}