示例#1
0
 /// <summary>
 /// 成品主计划
 /// </summary>
 /// <param name="sp"></param>
 /// <param name="fontName"></param>
 public static void grPicSMIN(DevExpress.XtraEditors.PictureEdit sp, string fontName)
 {
     sp.Paint += (s, e) =>
     {
         try
         {
             Point    p  = sp.PointToScreen(sp.Location);
             Graphics gp = e.Graphics;
             gp.Clear(LineProductMesBll.UserInfoMation.FeedColor);
             if (!fontName.Contains("反"))
             {
                 //画填充圆
                 //SolidBrush s = new SolidBrush ( Color . Red );
                 //画空心圆
                 Pen pen = new Pen(Color.Red, 2);
                 gp.DrawEllipse(pen, 5, sp.Location.Y - 8, 110, 45);
                 Font  myFont = new Font("楷体", 18);
                 Brush bush   = new SolidBrush(Color.Red);
                 gp.DrawString(fontName, myFont, bush, 95, sp.Location.Y + 5, new StringFormat(StringFormatFlags.DirectionRightToLeft));
             }
         }
         catch (Exception ex)
         {
             Utility.LogHelper.WriteLog(ex.Message);
         }
     };
 }
示例#2
0
 /// <summary>
 /// 组装  五金  注塑
 /// </summary>
 /// <param name="sp"></param>
 /// <param name="fontName"></param>
 public static void grPicZ(DevExpress.XtraEditors.PictureEdit sp, string fontName)
 {
     sp.Paint += (s, e) =>
     {
         try
         {
             Point    p  = sp.PointToScreen(sp.Location);
             Graphics gp = e.Graphics;
             gp.Clear(LineProductMesBll.UserInfoMation.FeedColor);
             if (!fontName.Contains("反"))
             {
                 //画填充圆
                 //SolidBrush s = new SolidBrush ( Color . Red );
                 //画空心圆
                 Pen       pen = new Pen(Color.Red, 2);
                 Rectangle rec = new Rectangle(sp.Width / 4, sp.Height / 4, 50, 90);
                 //gp . DrawRectangle ( pen ,rec );
                 gp.DrawPath(pen, DrawRoundRect(rec, 12));
                 //gp . DrawEllipse ( pen ,10 ,sp . Location . Y - 5 ,60 ,120 );
                 Font  myFont = new Font("隶书", 15, FontStyle.Bold);
                 Brush bush   = new SolidBrush(Color.Red);
                 gp.DrawString(fontName, myFont, bush, sp.Width / 4 + 2, sp.Height / 4 + 5, new StringFormat(StringFormatFlags.DirectionVertical));
             }
         }
         catch (Exception ex)
         {
             Utility.LogHelper.WriteLog(ex.Message);
         }
     };
 }