/// <summary> /// 添加时间 /// </summary> /// <param name="cardNum">控制卡地址码</param> /// <param name="g_iProgramIndex">节目号</param> /// <param name="date">是否显示日期</param> /// <param name="week">是否显示星期</param> /// <param name="time">是否显示时间</param> /// <param name="fontName">字体名称</param> /// <param name="fontSize">字体大小</param> /// <param name="fontColor">字体颜色</param> /// <returns></returns> public static bool AddDateTime(int cardNum, int g_iProgramIndex, bool date, bool week, bool time, string fontName, int fontSize, int fontColor, bool bMulOrSingleLine) { User_DateTime DateTime = new User_DateTime(); DateTime.bDay = date; DateTime.bHour = time; DateTime.BkColor = 0; DateTime.bMin = time; DateTime.bMouth = date; DateTime.bMulOrSingleLine = bMulOrSingleLine;//单行 多行 DateTime.bSec = time; DateTime.bWeek = week; DateTime.bYear = date; DateTime.bYearDisType = false; DateTime.chTitle = ""; DateTime.PartInfo.iFrameMode = 1; DateTime.iDisplayType = 1; DateTime.PartInfo.FrameColor = fontColor; DateTime.PartInfo.iHeight = 32; DateTime.PartInfo.iWidth = 128; DateTime.PartInfo.iX = 0; DateTime.PartInfo.iY = 0; DateTime.FontInfo.bFontBold = false; DateTime.FontInfo.bFontItaic = false; DateTime.FontInfo.bFontUnderline = false; DateTime.FontInfo.colorFont = fontColor; DateTime.FontInfo.iAlignStyle = 1; DateTime.FontInfo.iVAlignerStyle = 1; DateTime.FontInfo.iFontSize = fontSize; DateTime.FontInfo.strFontName = fontName; if (-1 == User_AddTime(cardNum, ref DateTime, g_iProgramIndex)) { return(false); } else { return(true); } }
//添加时间 private void button6_Click(object sender, EventArgs e) { User_DateTime DateTime = new User_DateTime(); DateTime.bDay = false; DateTime.bHour = true; DateTime.BkColor = 0; DateTime.bMin = true; DateTime.bMouth = false; DateTime.bMulOrSingleLine = false; DateTime.bSec = true; DateTime.bWeek = false; DateTime.bYear = false; DateTime.bYearDisType = false; DateTime.chTitle = ""; DateTime.PartInfo.iFrameMode = 1; DateTime.iDisplayType = 1; DateTime.PartInfo.FrameColor = 0xFFFF; DateTime.PartInfo.iHeight = 32; DateTime.PartInfo.iWidth = 64; DateTime.PartInfo.iX = 0; DateTime.PartInfo.iY = 0; DateTime.FontInfo.bFontBold = false; DateTime.FontInfo.bFontItaic = false; DateTime.FontInfo.bFontUnderline = false; DateTime.FontInfo.colorFont = 0xFF; DateTime.FontInfo.iAlignStyle = 1; DateTime.FontInfo.iFontSize = 12; DateTime.FontInfo.strFontName = "宋体"; if (-1 == User_AddTime(g_iCardNum, ref DateTime, g_iProgramIndex)) { MessageBox.Show("添加时间失败!"); } else { MessageBox.Show("添加时间成功!"); } }
public static extern int User_AddTime(int CardNum, ref User_DateTime pdateTime, int iProgramIndex);