private void btnApplyOSDText_Click(object sender, EventArgs e) { m_nOsdNum1 = (uint)comboxOSDLayer1.SelectedIndex; m_xoffset1 = Convert.ToInt32(txtBox_Xoffset1.Text); m_yoffset1 = Convert.ToInt32(txtBox_Yoffset1.Text); m_width1 = Convert.ToInt32(txtBox_width1.Text); m_height1 = Convert.ToInt32(txtBox_height1.Text); m_dwFontColor = ColorToUInt(txtBoxTypeString.ForeColor); m_dwBackgroundColor = ColorToUInt(m_clrBackground); m_pszFontFamilyName = txtBoxTypeString.Font.FontFamily.Name; m_nFontStyle = (uint)txtBoxTypeString.Font.Style; Font txtFont = txtBoxTypeString.Font; bool bBold = txtFont.Bold; if (bBold) { m_nFontStyle |= (uint)EXPORTS.FontStyleEnum.QCAP_FONT_STYLE_BOLD; } bool bItalic = txtFont.Italic; if (bItalic) { m_nFontStyle |= (uint)EXPORTS.FontStyleEnum.QCAP_FONT_STYLE_ITALIC; } bool bStrikeout = txtFont.Strikeout; if (bStrikeout) { m_nFontStyle |= (uint)EXPORTS.FontStyleEnum.QCAP_FONT_STYLE_STRIKEOUT; } bool bUnderline = txtFont.Underline; if (bUnderline) { m_nFontStyle |= (uint)EXPORTS.FontStyleEnum.QCAP_FONT_STYLE_UNDERLINE; } m_nFontSize = Convert.ToUInt32(comboxFontSize1.Text); m_nTransparent1 = Convert.ToUInt32(txtBox_Transparent1.Text); m_pszString = txtBoxTypeString.Text; if (m_hCapDev[0] != 0) { string str_string = m_pszString; string str_font_family_name = m_pszFontFamilyName; EXPORTS.QCAP_SET_OSD_TEXT(m_hCapDev[0], m_nOsdNum1, m_xoffset1, m_yoffset1, m_width1, m_height1, ref str_string, ref str_font_family_name, m_nFontStyle, m_nFontSize, m_dwFontColor, m_dwBackgroundColor, m_nTransparent1); } if (m_hCapDev[1] != 0) { string str_string = m_pszString; string str_font_family_name = m_pszFontFamilyName; EXPORTS.QCAP_SET_OSD_TEXT(m_hCapDev[1], m_nOsdNum1, m_xoffset1, m_yoffset1, m_width1, m_height1, ref str_string, ref str_font_family_name, m_nFontStyle, m_nFontSize, m_dwFontColor, m_dwBackgroundColor, m_nTransparent1); } if (m_hCapDev[2] != 0) { string str_string = m_pszString; string str_font_family_name = m_pszFontFamilyName; EXPORTS.QCAP_SET_OSD_TEXT(m_hCapDev[2], m_nOsdNum1, m_xoffset1, m_yoffset1, m_width1, m_height1, ref str_string, ref str_font_family_name, m_nFontStyle, m_nFontSize, m_dwFontColor, m_dwBackgroundColor, m_nTransparent1); } if (m_hCapDev[3] != 0) { string str_string = m_pszString; string str_font_family_name = m_pszFontFamilyName; EXPORTS.QCAP_SET_OSD_TEXT(m_hCapDev[3], m_nOsdNum1, m_xoffset1, m_yoffset1, m_width1, m_height1, ref str_string, ref str_font_family_name, m_nFontStyle, m_nFontSize, m_dwFontColor, m_dwBackgroundColor, m_nTransparent1); } }