This example uses the GetSelectedAnnotationFillStyle method to determine whether a selected image or filled rectangle annotation is opaque or transparent, and the SetSelectedAnnotationFillStyle method to change the fill style.
void CLineStyles::OnOK()
{
if(m_Transparent.GetCheck() && m_bLineStyle)
m_pParent->ImgEdit1.SetSelectedAnnotationLineStyle(0);
else
m_pParent->ImgEdit1.SetSelectedAnnotationLineStyle(1);
if(m_Transparent.GetCheck() && !m_bLineStyle)
m_pParent->ImgEdit1.SetSelectedAnnotationFillStyle(0);
else
m_pParent->ImgEdit1.SetSelectedAnnotationFillStyle(1);
CDialog::OnOK();
}
BOOL CLineStyles::OnInitDialog()
{
CDialog::OnInitDialog();
short LineStyle;
// Determine if the selected line or fill annotation is opaque or
// transparent and set the corresponding option button on
// the form.
if(m_bLineStyle)
LineStyle = m_pParent->ImgEdit1.GetSelectedAnnotationLineStyle();
else
{
LineStyle = m_pParent->ImgEdit1.GetSelectedAnnotationFillStyle();
SetWindowText("Fill Styles");
}
if(LineStyle == 1) // wiOpaque
{
m_Opaque.SetCheck(1);
m_Transparent.SetCheck(0);
}
else
{
m_Opaque.SetCheck(0);
m_Transparent.SetCheck(1);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}