Пример #1
0
 public CustomFigureToolButton(CustomFigureTool t)
     : base(t)
 {
     Image = Resource1.technocolor;
     FigureClass = t.FigureClass;
     Dap = t.Dap;
     if (t.Base64Icon != null)
     {
         Bitmap bmp = WorkBookUtils.Base64ToBitmap(t.Base64Icon);
         Bitmap bmp2;
         Graphics g;
         if (bmp.Width > Height)
         {
             bmp2 = new Bitmap(bmp.Width, bmp.Width);
             g = Graphics.FromImage(bmp2);
             g.DrawImage(bmp, new PointF(0, bmp2.Height / 2 - bmp.Height / 2));
         }
         else
         {
             bmp2 = new Bitmap(bmp.Height, bmp.Height);
             g = Graphics.FromImage(bmp2);
             g.DrawImage(bmp, new PointF(bmp2.Width / 2 - bmp.Width / 2, 0));
         }
         g.Dispose();
         bmp.Dispose();
         Image = bmp2;
     }
 }
Пример #2
0
 private void tsEngineState_AddToPersonalTools(object sender, CustomFigureTool customFigure)
 {
     tsPersonal.AddCustomFigure(customFigure);
 }
Пример #3
0
 public void AddCustomFigure(CustomFigureTool customFigure)
 {
     Items.Add(new CustomFigureToolButton(customFigure));
 }