public TooltipsLabSettingsDialogBox(MsoAutoShapeType selectedShapeType, MsoAnimEffect selectedAnimType)
 {
     lastSelectedShapeType = selectedShapeType;
     lastSelectedAnimType  = selectedAnimType;
     InitializeComponent();
     Initialize();
 }
 public TooltipsLabSettingsShapeEntry(MsoAutoShapeType type, Bitmap image)
 {
     InitializeComponent();
     Type            = type;
     imageBox.Source = Imaging.CreateBitmapSourceFromHBitmap(
         image.GetHbitmap(),
         IntPtr.Zero,
         Int32Rect.Empty,
         BitmapSizeOptions.FromEmptyOptions());
 }
Example #3
0
        protected Excel.Shape AddShape(MsoAutoShapeType shapeType, Rect rect, Color color)
        {
            Excel.Shape shape = Chart.Shapes.AddShape(shapeType,
                                                      (float)rect.Left, (float)rect.Top,
                                                      (float)rect.Width, (float)rect.Height);

            shape.Fill.ForeColor.RGB = color.ToRgb();
            shape.Fill.Transparency  = color.GetAlpha();
            Shapes.Add(shape);
            return(shape);
        }
Example #4
0
 public ShapeAttributes(PowerPoint.Shape shape)
 {
     Left     = shape.Left;
     Top      = shape.Top;
     Width    = shape.Width;
     Height   = shape.Height;
     Rotation = shape.Rotation;
     Type     = shape.AutoShapeType;
     Color    = shape.Fill.ForeColor.RGB;
     Name     = shape.Name;
     // FIXME: This doesn't work when you add text to an AutoShape
     if (shape.Type == MsoShapeType.msoTextBox)
     {
         Text = shape.TextFrame.TextRange.Text;
         Font = shape.TextFrame.TextRange.Font.Name;
         Size = shape.TextFrame.TextRange.Font.Size;
     }
 }
Example #5
0
        public XlShape AddShape(MsoAutoShapeType type, Single left, Single top, Single width, Single height)
        {
            object[] parameters = new object[5];
            parameters[0] = type;
            parameters[1] = left;
            parameters[2] = top;
            parameters[3] = width;
            parameters[4] = height;
            object returnValue = InstanceType.InvokeMember("AddShape", BindingFlags.InvokeMethod | BindingFlags.OptionalParamBinding, null, ComReference, parameters, XlLateBindingApiSettings.XlThreadCulture);

            if (null == returnValue)
            {
                return(null);
            }
            XlShape newClass = new XlShape(this, returnValue);

            ListChildReferences.Add(newClass);
            return(newClass);
        }
Example #6
0
 public TooltipsLabSettingsShapeEntry(MsoAutoShapeType type, Bitmap image)
 {
     InitializeComponent();
     Type            = type;
     imageBox.Source = GraphicsUtil.BitmapToImageSource(image);
 }
        /// <summary>返回一个 Shape 对象,该对象表示工作表中的新自选形状。
        /// 说明:
        /// 要更改已添加的自选形状的类型,请设置 AutoShapeType 属性。
        /// </summary>
        /// <param name="Type">指定要创建的自选形状的类型。</param>
        /// <param name="Left">自选形状边框的左上角相对于文档左上角的位置(以磅为单位)。</param>
        /// <param name="Top">自选形状边框的左上角相对于文档左上角的位置(以磅为单位)。</param>
        /// <param name="Width">自选形状边框的宽度(以磅为单位)。</param>
        /// <param name="Height">自选形状边框的高度(以磅为单位)。</param>
        /// <returns></returns>
        public Shape AddShape(MsoAutoShapeType Type, double Left, double Top, double Width, double Height)
        {
            _objaParameters = new object[5] { Type, Left, Top, Width, Height };
            object objShape = _objShapes.GetType().InvokeMember("AddShape", BindingFlags.InvokeMethod, null, _objShapes, _objaParameters);

            return new Shape(objShape);
        }
        protected Excel.Shape AddShape(MsoAutoShapeType shapeType, Rect rect, Color color)
        {
            Excel.Shape shape = Chart.Shapes.AddShape(shapeType,
                                (float)rect.Left, (float)rect.Top,
                                (float)rect.Width, (float)rect.Height);

            shape.Fill.ForeColor.RGB = color.ToRgb();
            shape.Fill.Transparency = color.GetAlpha();
            Shapes.Add(shape);
            return shape;
        }